I have done a PHP web application and my client request to host it at their server. How can I protect my PHP code so that it will not be viewed, study, or take it for any other usage by my client?
You can encode your code using ionCube and similar products. Your client won't be able to view, study or take it.
However, everything can be reverse engineered meaning that, no matter how you encode your code, it can be decoded. For example, ionCube can be decoded with decry.pt. It works, I can confirm it.
So you'll never be able to really secure your code but this is a good start.
Of course, after encoding the script, make sure that the client isn't allowed to view, study or take it. Choose a proper license for your script.
Make sure you have a signed written contract between you and the client stating the conditions for license use so the license is enforceable in a court of law.