如何学习PHP set_include_path()

2026-02-18 04:01:46

set_include_path函数理解1

set_include_path函数的作用为设置 include_path 配置选项

1.include_path配置选项如何理解;

2.配置选项是否给定了值;

set_include_path函数理解2

说明 

string set_include_path ( string $new_include_path )

为当前脚本设置 include_path 运行时的配置选项。

1.set_include_path函数作用的返回值是否为字符串类型;

2.set_include_path设置当前脚本的配置项如何理解;

3.若成功时返回旧的 include_path 或者在失败时返回 FALSE。

set_include_path函数理解3

<?php// 自 PHP 4.3.0 起可用

echo set_include_path('/usr1/lib/pear');// 在所有版本的 PHP 中均可用 echo ini_set('include_path', '/usr1/lib/pear');

?>

输出结果为:.;C:\php5\pear/usr1/lib/pear 

<?php

$path1 = '/usr1/lib/pear';//$path1如何理解;

set_include_path(get_include_path() . PATH_SEPARATOR . $path1);//get_include_path()是否获取到了include_path的配置选项;

?>

输出结果为:.;C:\php5\pear 

相关推荐
  • 阅读量:37
  • 阅读量:147
  • 阅读量:74
  • 阅读量:93
  • 阅读量:103
  • 猜你喜欢