function load($className) {
$path = $className.'php';
if (file_exists($path)) {
require_once($path);
} else {
echo $path.'The file does not exist, please check~~~';
}
}
sql_autoload_register('load');
echo (new Test('www.php. com'))->name;
A 年轻在于拼2019-09-17 11:35:34
It’s so scary. I watched Peter Pig’s video for about 10 minutes. I looked and looked at it, but I didn’t find that it was sql. When I came here to watch it, I found that the correct one was spl.
p p p ~~~~
Langic2018-12-19 17:59:38
spl_autoload_register, I also made the same mistake. After using sql statements for a long time, I got used to it, hahaha
天蓬老师2018-12-12 09:03:34
This is the PHP standard library function, it should start with: spl, you spelled it wrong: sql