<?php function __autoload($className=null) { $classes = array ( 'QTag.class.php', 'QTagNode.class.php', 'QCommonTags.class.php', ); foreach($classes as $class) { include_once($class); } if(!class_exists($className)) { include_once($className.".class.php"); } }