Note this function will LOWERCASE the class names its looking for, dont be confused when it cant find Foo_Bar.php
also, unlike most other autoloader code snippets, this function DOES NOT translate underscores to slashes.
class Foo_Bar {}
will load foo_bar.php and will not try to load foo/bar.php
You can get around this with
spl_autoload_register(function($class) { return spl_autoload(str_replace('_', '/', $class));});