当前位置:Gxlcms > PHP教程 > get_include_path函数的问题

get_include_path函数的问题

时间:2021-07-01 10:21:17 帮助过:5人阅读

我在使用
get_include_path 函数时,出现的字符串如下:

.;C:\php\pear

请解释这个函数为什么会返回这个字符串??

这些字符串分别代表什么含义??

谢谢。


回复讨论(解决方案)

对应的函数是set_include_path() 设置某个目录为自动包含路径,这样这个目录下的文件,你可以直接include 而不需要写路径了

get_include_path() 获取当前的环境变量,取php.ini里设置的 include_path路径

返回的是 php.ini 中 include_path 设定的值
.;C:\php\pear 的含义是:
. 从当前目录检查被包含的文件是否存在
C:\php\pear 从 C:\php\pear 目录检查被包含的文件是否存在
分号表示并列的意思,小学语文就讲授了

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"

人气教程排行