This function will allow to add a class file without including the file.
__autoload() function will call automatically while creating the object.
it will automatically include all classes while creating the objects
See the example
1 2 3 4 5 6 7 8 9 |
<? function __autoload($ClassName) { include($ClassName.".php"); } $mydoubtsobject = new mydoubtclass(); $mydoubtsobject1 = new mydoubtclass1(); ?> |
Note:for this we have to give filename and class name as same. otherwise it will not work.