Encryting source code isn't a good idea.
There would be a way to do it in php, by having the code it renders encrypted using MD5 or Sha1, php.net look into it MD5 is most supported, but then again it can be cracked using rainbow tables, and to get the hash they would only have to view your source...
http://php.net/md5
Sha1 on the other hand is almost impossible to decode, I would go with that.
http://php.net/sha1