Auto loading classes

I tried to use the following code to load my classes automatically.

PHP:

spl_autoload_extensions(".php"); // comma-separated list

    spl_autoload_register();

It works, but only those classes that are on the same directory. How do I include other classes that are on sub directory?

See original post by samyak

Leave a Reply