set_include_path
include_path 구성 옵션을 설정합니다
함수 이름 : set_include_path ()
해당 버전 : 모든 PHP 버전
함수 설명 : set_include_path () 함수는 php의 포함 파일 검색 경로를 설정하는 데 사용됩니다. 포함 된 파일 검색 경로를 설정하면 파일을 포함 할 때 PHP를보다 유연하고 편리하게 만들 수 있습니다.
구문 : set_include_path (String $ new_include_path) : String | false
매개 변수 :
반품 값 :
예:
$path = '/path/to/includes'; $result = set_include_path($path); if ($result !== false) { echo "包含文件搜索路径已设置为: $result"; } else { echo "设置包含文件搜索路径失败"; }
$paths = array( '/path/to/includes1', '/path/to/includes2', '/path/to/includes3' ); $result = set_include_path(implode(':', $paths)); if ($result !== false) { echo "包含文件搜索路径已设置为: $result"; } else { echo "设置包含文件搜索路径失败"; }
$currentPath = get_include_path(); echo "当前的包含文件搜索路径为: $currentPath";
참고 :