Forum Moderators: coopster
Where do I save a PHP class file so that PHP pages can find it without an include file?
I'm asking for the equivalent of the JAVA CLASSPATH or the Perl @INC array.
Example:
include("/some/path/SomeClass.php"); # Would like to get rid of this
$object = new SomeClass();
[pre]function __autoload($class_name) {
$file='/path/to/classes/' . $class_name . '.class.php';
if(file_exists($file)){
require_once $file;
}
}[/pre]