spl_autoload_register 自动载入
2015-09-14 22:13
423 查看
<?php
spl_autoload_register('autoload1');
spl_autoload_register('autoload2');
test1::test();
test2::test();
function autoload1($class){
include strp(__DIR__).'/'.$class.'.php';
}
function autoload2($class){
include strp(__DIR__).'/'.$class.'.php';
}
function strp($path){
return str_replace('\\', '/', $path);
}
?>
spl_autoload_register('autoload1');
spl_autoload_register('autoload2');
test1::test();
test2::test();
function autoload1($class){
include strp(__DIR__).'/'.$class.'.php';
}
function autoload2($class){
include strp(__DIR__).'/'.$class.'.php';
}
function strp($path){
return str_replace('\\', '/', $path);
}
?>
相关文章推荐
- [leetcode 23]Merge k Sorted Lists
- 使用PHP的GET和POST实现iOS的http网络通信
- 2015联考1、912模拟总结
- TCP/IP三次握手与四次握手
- linux常用命令(33):df 命令
- [dijkstra]
- 探讨read的返回值的三种情况
- 电脑内无法预览图片
- eclipse 快捷键
- 用js实现跳转页面的方法
- android学习之路之接口回调的理解
- C++的STL进一步总结之pair
- 标准SQL的update语句三种用法
- POJ 1703 Find them, Catch them(经典并查集)
- hdu 4462 构造子集+枚举
- rectint 函数
- 原生js实现跑马灯抽奖效果
- 二、面向对象设计三大特性-----《大话设计模式》
- PS技巧:如何优雅的抠公章?
- 从图看Linux问题分析的工具