Menu
I was going to load all my classes via a php script to save adding new classes as I create them. Using the code below.
The issue is I have a class apples.php for example, which is loaded before database.php due to the alphabetical order pages are found in.
apples.php is extended database.php so therefore I get this error
Fatal error: Uncaught Error: Class ‘dbh’ not found in
Other than renaming database.php a_database.php or something similar what else can I do?
Surely this is a common issue?
“`
foreach (glob(“../classes/*.php”) as $filename){
require_once $filename;
}