Suppose I need to automatically include files (classes) from different directories. But if I write an autoloader according to my knowledge, the following picture appears:
function __autoload($class) { if(is_file('controllers/' . $class . '.php')) include_once 'controllers/' . $class . '.php'; }
I check for the file in the controllers directory. Is it possible to set the directories by which files should be searched?