Problem with spl_autoload_register

See all posts Reply

Problem with spl_autoload_register new!
by kesm0, 11 years, 2 months ago
Hello !

I'm using an autoload class to automaticly use the good class. it looks like :
function autoload($class) {
  str_replace('\\', '/', $class) . '.class.php';
}
spl_autoload_register('autoload');

And when i use it the class upload didn't work, did you have any ideas or hint to solve it ?Reply
Re: Problem with spl_autoload_register new!
by Marc, 11 years, 1 month ago
I think it's because the name of the class is class.upload.php
you have to rename it upload.class.php

here is my autoloader : it work with the class renamed
function my_autoloader($classe) {
  include 'class/'.$classe.'.class.php';
}
spl_autoload_register('my_autoloader');
Reply