One of the greatest function ever added to PHP5 is __autoload(). It has been a very efficient help especially for an OOP-driven site. Through this function, there is no longer a need to include/require your class file every now and then. Once you have configured your __autoload() function, you are now good to go.
But what if you are using PHP4?
Just last week, I got devastated when I was informed that PHP version of my client was still in PHP4. My OOP coding was already in PHP5. I have to reconstruct my coding to adapt the server. So sad.
For some time I tried to think for a remedy. Luckily after some time, I found a solution.
in PHP 5
in PHP 4
This code works assuming that the filename is the same as the class name.
Just add the file checking using file_exists() function.
Hope this helps.