Automatically Loading Include Files with ___autoload() : __autoload « Class « PHP






Automatically Loading Include Files with ___autoload()

 
<?php
function ___autoload ($class) {
  $file = "$class.inc.php";
  include_once( $file );
}
$test = new YourClassName();
?>
  
  








Related examples in the same category

1.Creating an __autoload() Function
2.__autoload( ) is called whenever you try to create an object of a class that hasn't been defined
3.__autoload() function automatically includes a class file.
4.Using the __autoload() Function