关于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,有则自动包含并停止查找
通过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,有则自动包含并停止查找
相关文章推荐
- set_include_path和get_include_path用法详解
- set_include_path和get_include_path用法详解
- set_include_path和get_include_path用法详解
- set_include_path get_include_path
- 设置include和require的目录get_include_path与set_include_path
- php的set_include_path与get_include_path()的用法
- set_include_path, get_include_path 使用
- set_include_path和get_include_path用法详解
- set_include_path和get_include_path用法详解
- set_include_path和get_include_path使用及注意事项
- php手记-set_include_path和get_include_path用法详解
- 【php】set_include_path和get_include_path用法详解
- set_include_path和get_include_path用法详解
- set_include_path, get_include_path
- set_include_path和get_include_path用法详解
- set_include_path和get_incl…
- set_include_path和get_include_path使用及注意事项
- 关于PHP的set_include_path()函数
- set_include_path() &&get_include_path()用法
- php 文件路径设置 set_include_path(); get_include_path();