How do you load classes in PHP?

Review the “autoload” and “spl_autoload_register” function (note:you should use the later). The autoload function basically triggers a function when a class is instantiated, you can put whatever logic you like in it but generally you want to include the class file based on some sort of naming convention.

Gaurav Kumar

Hi, my name is Gaurav Kumar and I specialize in Computer Software industry. I have been working as a Software Developer from last 3+ years,and its my passion to learn new technology and sharing what I've learned.