set_include_path()function 是一个内置函数PHP设置 include_path 配置选项。
用法:
string|false set_include_path(string $include_path)
Parameters: 该函数接受一个参数,如下所述:
- $include_path: 此参数指定include_path 的新值。
返回值:如果成功,此函数返回旧的include_path,否则返回“false”。
示例 1:在此示例中,我们将使用set_include_path()函数。
PHP
<?php
$path = "/home/dachman" ;
if(true == set_include_path($path)){
echo "Path is set now" ;
} else {
echo "Path is not set now" ;
}
?>
输出:
The path is set now
示例 2:在下面的代码中,我们将在使用之前检查路径set_include_path()函数。
PHP
<?php
$path = "/home/dachman" ;
// Before using set_include_path() function.
echo get_include_path()."\n";
set_include_path($path) ;
echo get_include_path() ;
?>
输出:
.:/usr/share/php /home/dachman
参考: https://www.php.net/manual/en/function.set-include-path.php
相关用法
- PHP set_file_buffer()用法及代码示例
- PHP set_error_handler()用法及代码示例
- PHP set_exception_handler()用法及代码示例
- PHP settype()用法及代码示例
- PHP setlocale()用法及代码示例
- PHP session_abort()用法及代码示例
- PHP session_cache_expire()用法及代码示例
- PHP session_cache_limiter()用法及代码示例
- PHP session_commit()用法及代码示例
- PHP session_create_id()用法及代码示例
- PHP session_decode()用法及代码示例
- PHP session_destroy()用法及代码示例
- PHP session_encode()用法及代码示例
- PHP session_gc()用法及代码示例
- PHP session_get_cookie_params()用法及代码示例
- PHP session_id()用法及代码示例
- PHP session_module_name()用法及代码示例
- PHP session_name()用法及代码示例
- PHP session_regenerate_id()用法及代码示例
- PHP session_register_shutdown()用法及代码示例
- PHP session_reset()用法及代码示例
- PHP session_save_path()用法及代码示例
- PHP session_set_cookie_params()用法及代码示例
- PHP session_set_save_handler()用法及代码示例
- PHP session_start()用法及代码示例
注:本文由纯净天空筛选整理自neeraj3304大神的英文原创作品 PHP set_include_path() Function。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。