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

e.g.
[code lang=”php”]
function __autoload($class_name) {
require_once $class_name . ‘.php’;
}
[/code]

Categories: ContentGeneral

Leave a Reply

Your email address will not be published. Required fields are marked *