<p >set_include_path<br />
(PHP 4 >= 4.3.0, PHP 5)</p>
<p >set_include_path -- Sets the include_path configuration option<span class="Apple-converted-space"></span><br />
Description<br />
string set_include_path ( string new_include_path )</p>
<p ><br />
Sets the include_path configuration option for the duration of the script. Returns the old include_path on success or FALSE on failure.</p>
<p >例子 1. set_include_path() example</p>
<p ><?php<br />
// Works as of PHP 4.3.0<br />
set_include_path('/inc');</p>
<p >// Works in all PHP versions<br />
ini_set('include_path', '/inc');<br />
?><span class="Apple-converted-space"></span><br />
</p>
<p ><br />
例子 2. Adding to the include path</p>
<p >Making use of the PATH_SEPARATOR constant, it is possible to extend the include path regardless of the operating system.</p>
<p >In this example we add /usr/lib/pear to the end of the existing include_path.</p>
<p ><?php<br />
$path = '/usr/lib/pear';<br />
set_include_path(get_include_path() . PATH_SEPARATOR . $path);<br />
?><span class="Apple-converted-space"></span><br />
</p>
<p ></p>