I know that many companies that sell scripts have it encrpyed so you dont have the source code but the PHP is still run, so you dont know how it works exactly.
Anyways, if anyone can tell/explain/give me a link on how to do this.. thanks
You need some encoding software such as Zend Encoder or ionCube Encoder (personally I use the latter, because a) it's cheaper and b) I find it easy to use).
Neither of those two are free, I believe MM_Cache is free but I never got the hang of it.
All binary encoding PHP software requires a loader of some sort to allow it to execute on the system. Zend uses Zend Optimiser and ionCube uses ionCube Loader these are both free and certainly in the case of ionCube loader you can ship it with your software and if safe mode is off and dynamic loading are enabled (often they are) the Loader can be loaded to PHP at run time. If safe mode is on or dynamic loading is disabled you have to add the loader to PHP.ini
Unfortunately there is no way around that as the Loaders are essential to executing these scripts. However because they are binary encoded there is no way to get the PHP source back again.
I don't encode my entire scripts as I like to allow people to modify their code (of course there is a danger of people ripping off code still) but I do encode my setup routines.