Load a PHP Class automatically upon instantiation (PHP5)


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function __autoload($class_name) {
  2. require_once("classes/" . $class_name . ".php");
  3. }
  4.  
  5. $auth = new Auth;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.