The Set_include_path () function can dynamically change PHP's include_path parameters in a PHP program, which is a string, and multiple different directories can be concatenated together as a parameter--separate directories using a directory split symbol, In a Unix-like system, this delimiter is ":" In the Windows system this delimiter is ";", so PHP provides a constant path_separator to represent this delimiter in the current system.
set_include_path-Set Include_path configuration options
Description
String Set_include_path (String $new _include_path)
Sets the configuration options for the Include_path runtime for the current script.
Parameters
New_include_path
Include_path the new value.
return value
Returns an old include_path on success or returns FALSE on failure.
Instance One
<?php
///from PHP 4.3.0 available
set_include_path ('/usr/lib/pear ');
ini_set (' include_path ', '/usr/lib/pear ') are available in all versions of PHP.
>
Example Two
Add to include path
Use constant Path_separator to extend include PATH across platforms.
In this example we add/usr/lib/pear to the tail of the existing include_path.
<?php
$path = '/usr/lib/pear ';
Set_include_path (Get_include_path (). Path_separator. $path);
? >
Thank you for reading, I hope to help you, thank you for your support for this site!