在 PHP 中,set_include_path 相对于什么?它是 PHP.exe 所在的文件夹吗?是网盘吗?换句话说,set_include_path('/') 或 set_include_path('.') 指的是什么文件夹?
最佳答案
相对路径从文件的位置解析,其中 include
或使用 include_path 的另一个函数用于(参见 description of include_path):
Using a
.
in the include path allows for relative includes as it means the current directory. However, it is more efficient to explicitly useinclude './file'
than having PHP always check the current directory for every include.
/
将描述文件系统的根目录和 .
当前目录。
关于php - PHP 的 set_include_path 的 "Starting Point"是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2186244/