标题几乎是不言自明的...
我需要在 php 中做与 dos 使用命令相同的事情:
path %windir%/whateverdirectory
所以爱荷华
<?php
//if file is NOT exists on the current directory look for other default directory
require_once('thisFileIsNotInCurrentDirectoryButStillFoundable.php');
?>
知道吗?
提前感谢!
您要设置"include_path"配置选项,该选项(源(:
指定 require、include、fopen((、file((、readfile(( 和 file_get_contents(( 函数在其中查找文件的目录列表。格式类似于系统的 PATH 环境变量:在 Unix 中用冒号分隔或在 Windows 中用分号分隔的目录列表。
PHP 在查找要包含的文件时分别考虑包含路径中的每个条目。它将检查第一个路径,如果找不到,请检查下一个路径,直到找到包含的文件或返回警告或错误。您可以在运行时使用 set_include_path(( 修改或设置包含路径。