php的set_include_path函数
来源:互联网 发布:最好看的网络历史小说 编辑:程序博客网 时间:2024/05/22 09:43
php的set_include_path函数,是用来设置应用程序目录的,开发项目时合理应用此函数, 可以让我们在include时不用一层一层的计算目录,还可以提高我们开发的效率,减少文件包含错误率
看个例子
新建2个php文件,一个目录位置结构如下
/index.php
/include/config.php
index.php Code:
/include/config.php Code:
现在我们运行index.php 怎么样,看到结果没,我们include时只用写config.php就可以把/inlcude/config.php 文件包含进来.
设定多个include目录时用 " ;" 号分开。如: set_include_path("include;include2;include3;lib;c:/php/lib");可以用相对路径也可以用相对路径. 或许这段小小的代码你可能感觉不出set_include_path的好处,不过不要紧,你只要记住这么个代码可以实现这样的功能即可,在你以后技 术提上去,开时开发大型项目时不要忘了有这么个函数,他可以减少你的工作量.
姐妹函数get_include_path() 可以获取当时的include目录, 实现set_include_path同样功能的还有我们强大又可爱的ini_set() 用法:
ini_set('include_path', '目录名');
- php的set_include_path函数
- PHP的set_include_path函数
- 关于PHP的set_include_path()函数
- php中set_include_path函数的用法
- PHP 函数: set_include_path
- php函数set_include_path()用法详解
- php 非常有用的高级函数PATH_SEPARATOR常量和set_include_path
- PHP中set_include_path()函数相关用法分析
- PHP框架优化之-set_include_path函数
- php的set_include_path与get_include_path()的用法
- PHP中set_include_path
- set_include_path函数解析
- set_include_path()的用法
- php中的路径问题与set_include_path
- php手记-set_include_path和get_include_path用法详解
- PHP--set_include_path和get_include_path用法详解
- set_include_path的作用,为何使用XXX_SEPARATOR?
- 设置include和require的目录get_include_path与set_include_path
- android 通过 button 弹出 option menu 和 context menu
- 检讨 lock&unlock
- GTK Gossip: GtkCheckButton 與 GtkRadioButton
- const成员函数使用问题
- API实现窗口透明、滑动、淡入淡出等动画效果
- php的set_include_path函数
- csdn给我们的平台
- 绕过 Enigma Protector 2.xx 注册保护
- Platform来获取一些系统的路径和参数
- MY SQL 5安装文件的图解
- 《Inforworld》评出十大最有价值开源软件项目,linux内核,apache等软件项目榜上有名
- Android模仿Buttonbar(style="@android:style/ButtonBar")
- Wt简介
- Vaccination schedule