Is there any method by which I can hide the code of my php script from the client and prevent it from being distributed?? Something like a .war file in jsp ??
None of them are 100% guaranteed to protect your code. There's all sorts of hacks that are used to get the source reverse engineered
Yeah but most can be decrypted for a couple of bucks, if not cheaper...The tools to do it aren't hard to find either
try using a tool which uses variable,function and constant replacement as it won't depend on needing ioncube or zend optimiser installed to run the code.
If you want a cheap and easy solution you can go with the built-in bencoder. (search php.net for bencoder).