您的位置:首页 > 其它

关于get_include_path()和set_include_path()

2012-08-12 17:19 369 查看
get_include_path() include包含文件所在的所有目录 格式如下 目录;目录;目录

通过set_include_path()可以修改这些目录

PATH_SEPARATOR 分隔符 Linux(:) Windows(;)

例如

3个文件夹 "file01","file02","file03"

$include_path=get_include_path().PATH_SEPARATOR."file01/".PATH_SEPARATOR."file02/".PATH_SEPARATOR."file03/";

set_include_path($include_path);

function__autoload($className){

include strtolower($className).".class.php";

}

$class1=new Class1;

php会按顺序查找file01,file02,file03目录下是否包含 class1.class.php 这个文件 没有返回false,有则自动包含并停止查找
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: