__autoload() function automatically includes a class file. : __autoload « Class « PHP






__autoload() function automatically includes a class file.

 
function __autoload($classname) 
{ 
    require_once("/includes/classes/$classname.inc.php"); 
}
  
  








Related examples in the same category

1.Creating an __autoload() Function
2.Automatically Loading Include Files with ___autoload()
3.__autoload( ) is called whenever you try to create an object of a class that hasn't been defined
4.Using the __autoload() Function