PHP __autoload function

When PHP encounters a class that hasn’t been defined yet, you can use __autoload to automatically add them instead of including masses of included at the top of your files.

e.g.

function __autoload($class_name) {
  require_once $class_name . '.php';
}
Tags:
0 0 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments