Created
August 23, 2022 12:14
-
-
Save Kowalski7/bb82d9090746dd86b9af8bcb3bf44ef1 to your computer and use it in GitHub Desktop.
Various PHP utilities
This file contains hidden or 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('myAutoLoader'); | |
function myAutoLoader($className) { | |
// Configure path and extension to reflect your project structure | |
$path = "classes/"; | |
$ext = ".php"; | |
$fullPath = $path . $className . $ext; | |
if(!file_exists($fullPath)) { | |
return false; | |
} | |
include_once $fullPath; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment