Jump to Main Content
Content > Programming > PHP > PHP Cheat Sheet
PHP Cheat Sheet

Just some of the PHP tips/tricks I've looked up at one time or another and needed to be reminded how to do....

Class Definitions

PHP class definitions allow for a pseudo object-oriented programming methodology. This is a basic framework definition.

class objectName () {
    var varName1 = true;
    var varName2 = 42;

    function functionName (var=default) {
       // do something here;
    }
}

Misc Tips

Dynamic Object Values

Allows you to create object value names based upon an assigned variable.

e.g. $this->{"_".$key} = $val;

 


 
Comments are solely the opionion of the author and not to be construed as the opinion of anyone else.
Login
 

 

 

(c) 2006-2007 - Mark Boyden
Privacy - Legal Stuff - Contacts