The lightbulb has yet to go on for this...
I\'d really love an easy to understand explanation of the advantage to using a class in php over just using functions. <
A common thing to do since PHP5 was to create classes that act as libraries. This gives you the benefit of organizing your functionality and taking advantage of class features like __autoload();
For example, imagine you have two functions for encrypting and decrypting data. You can wrap them in a class (let's call it Encryption) and make them static functions. You can then use the functions like this (notice no initialization is needed (i.e. $obj = new Encryption)):
$encrypted_text = Encryption::encrypt($string);
and
$decrypted_text = Encryption::decrypt($string);
The benefits of this are: