Last active
March 30, 2021 12:59
-
-
Save bradsi/a857e49f2661f9391e9ede26cfd5c2ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
spl_autoload_register('autoLoader'); | |
function autoLoader($className) { | |
$url = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; | |
if (strpos($url, 'inc')) { | |
$path = '../classes/'; | |
} else { | |
$path = 'classes/'; | |
} | |
$ext = '.class.php'; | |
require_once $path . $className . $ext; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
spl_autoload_register('autoLoader'); | |
function autoLoader($className) { | |
$path = 'classes/'; | |
$ext = './class.php'; | |
require_once $path . $className . $ext; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment