<?php function my_autoloader_1($className) { $filename = 'test1/'.$className.'.php'; if (file_exists($filename)) { require_once $filename; } else { return false; } } # foo.php is in test2 function my_autoloader_2($className) { $filename = 'test2/'.$className.'.php'; if (file_exists($filename)) { require_once $filename; } else { return false; } } spl_autoload_register('my_autoloader_1'); spl_autoload_register('my_autoloader_2'); $a = new foo(); ?>
Post a Comment
0 comments:
Post a Comment