What is Autoloading; How do you use spl_autoload, __autoload and spl_autoload_register?
spl_autoload_register() allows you to register multiple functions (or static methods from your own Autoload class) that PHP will put into a stack/queue and call sequentially when a “new Class” is declared. So for example: spl_autoload_register(‘myAutoloader’); function myAutoloader($className) { $path=”/path/to/class/”; include $path.$className.’.php’; } //————————————- $myClass = new MyClass(); In the example above, “MyClass” is the name … Read more