What is the best way to protect PHP application ? Is it best to use ionCube PHP Encoder or Zend Guard or what else it could be used to protect the code ?
If you are referring to hide the PHP code from others, those are the two of the best ones out there to encrypt your code
The best way to protect it is to charge a prohibitively large price for it. That way even when people start to resell it (and they will, I assure you) you'll already have made your money on it so it wouldn't really matter. As a script author, I've found that the only way to make any money is to sell directly to marketers at a price that covers all of your development time, and letting them worry about pirates and licenses.