If the code resides on a computer a client controls, then it will be impossible to prevent them from 'tampering' with it. If you control the server, but the clients have access to that server, you would change write permissions of the php code.
Then again, if they tamper with the code, and things go titsup, then they have to employ you again to fix it :-)