Just to add what groovicus already said:
There are two types of scripting languages : client side scripting and server side scripting languages. Javascript, VBscript, etc are client side scripting languages. If you write code in these, the code is downloaded on client's computer and executed there. PHP, ASP etc are server side scripting languages, they execute on the server and only the output is downloaded on the client's computer.
This way a user visiting a website made in PHP or ASP cannot view the code but only the output generated by the scripting code.
Some people may use your PHP code by inspecting its behaviour.
For example, if you have a code that generates a N digit password, a person can use it using this link :
http://www.blah.com/generate.php?digits=5 and display the output in his/her own website.
It all depends on studying the behaviour of your code.
To protect PHP code so no body else can use it, you can contact your web site host to block such attempts.