Autoload for classes in the same folder
function __autoload($nomeClass) {
require_once ("$nomeClass.php");
}
Autoload for classes in specific folders
spl_autoload_register(function ($nomeClass) {
if (file_exists("Classes".DIRECTORY_SEPARATOR.$nomeClass.".php") === true) {
require_once ("Classes".DIRECTORY_SEPARATOR.$nomeClass.".php");
}
});
How would I make autoload work not just inside the "classes" folder but it load any call class anywhere in the project, how do I do that?