php function __autoload class_name require_once class_name php obj new

1
2
3
4
5
6
7
8
<?php
function __autoload($class_name) {
require_once $class_name . '.php';
}
$obj = new MyClass1();
$obj2 = new MyClass2();
?>