7 Star 14 Fork 5

Paul / PHP_SPL

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
5_1_autoload_register.php 488 Bytes
一键复制 编辑 Web IDE 原始数据 按行查看 历史
<?php
/**
* spl_autoload_register函数
* 类自动加载函数
*/
// 注册并返回spl_autoload函数使用的默认文件扩展名,可以有多个,先找第一个,如没有才找接下来的后缀
spl_autoload_extensions('.php, .class.php');
// 加载类的路径
set_include_path(get_include_path() . PATH_SEPARATOR . "5_1_Class/");
// 让类的自动加载生效
spl_autoload_register();
// 调用自动加载的类
new Test();
// 加载Test.php的Test,这是初始化
PHP
1
https://gitee.com/paultest/PHP_SPL.git
git@gitee.com:paultest/PHP_SPL.git
paultest
PHP_SPL
PHP_SPL
master

搜索帮助

14c37bed 8189591 565d56ea 8189591