get_include_path 函数的问题

WBOY
Release: 2016-06-23 13:59:09
Original
783 people have browsed it

我在使用
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"

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template