|
Using old code with new versions of PHPNow that PHP has grown to be a popular scripting language, there are a lot of public repositories and libraries containing code you can reuse. The PHP developers have largely tried to preserve backwards compatibility, so a script written for an older version will run (ideally) without changes in a newer version of PHP. In practice, some changes will usually be needed. Two of the most important recent changes that affect old code are:
For more details on these changes, see the section on predefined variables and links therein. Code Examples / Notes » tutorial.oldcodedreamer
When in your server the PHP directive register_globals is off, you can use function extract() to quickly create the short name for your variables. For example... <?php extract($_GET); echo $id; ?> But remember, this method is not out of danger, just like register_globals = on. |