In php, set_include_path will cause require. The include usage is different. For this problem, let's look at a simple example, as shown below. In php, set_include_path will cause require. The include usage is different. For this problem, let's look at a simple example, as shown below.
Script ec (2); script
In PHP, include and require are often used to reference other files and use relative or absolute paths. If you use the set_include_path function or ini_set ('include _ path', xxx) to set the include_path configuration option, the require file can be referenced directly in other directories.
Set include_path configuration options
For example: require_once "class. smarttemplate. php", this file is not actually in the directory where the current file is located, but can be directly referenced in this way. Because the include_path:
PHP
// Contains the configuration file and library path
Ini_set ('include _ path', INCLUDE_PATH. DS. "library". PATH_SEPARATOR. ini_get ('include _ path '));
Set_include_path Function
The set_include_path function has the same effect as the ini_set ('include _ pram', xxx) function, except that the ini_set method is suitable for all PHP versions. For now, there is no difference between the two.