As far as I know, as soon as you create a script that's genuinely your work - you attain copyright and it's yours to do with it what you like.
If someone steals your script, you can prosecute them by law but you need to be able to prove they actually have your work (design scraps, file dates, logs, whatever you have available that can prove it is your work).
To truly be effective, the copyright must be registered or applied for at some official agency. This really helps when fighting for your right against someone priating your work. To register at the US Copyright Office, it costs $45.
For more information see copyright.gov
In order to understand recursion, one must first understand recursion.
If you feel like it, you can read my blog
Signal > Noise
The envelope "trick" does indeed offer an accepted legal precedant in court - especially for material that has not been registered.
The first thing to do if you are selling this PHP as a commerical closed soruce product is to do as stealthdevil suggested and use a bytelevel encoder such as Zend or IonCube. It won't stop people from using the script if they can get their hands on it but it will keep its internals relatively safe from prying eyes.
From knowledge, if its yours and you have written it from scratch its yours and so much action can be taken. Im unsure about legal action but one way to stop code rippers is to encode it all, and also try to create a licence system for it.
you are the legit copyright's owner of your material at the moment you create it. However, the easiest way to be absolutely sure nobody will ever questionned it, would be to print the document then ask someone you know to sign the document with time/date.
█ PutFile.io — Disrupting traditional file hosting. █ Signup Early and enjoy Unlimited space/bandwidth for your files hosting, Forever! █ No Ads. █ No Countdowns.