If you state that you tried but it "didn't work" is not helping as we do not know what did not help as we can not see what you have tried.
If you would have Googled the new function - 'spl_autolaod_register you would have found the answer easily enough -
PHP's spl_autoload_register[
^]
As an example given from the manual -
<?php
function my_autoloader($class) {
include 'classes/' . $class . '.class.php';
}
spl_autoload_register('my_autoloader');
spl_autoload_register(function ($class) {
include 'classes/' . $class . '.class.php';
});
?>