What is it for and how to use include_path in php

3

I have many scripts using include_path, the problem is that the explanation of php.net I find a bit confusing, I can not understand how it works and what it does, help me please

    
asked by anonymous 13.03.2017 / 04:05

1 answer

1

In simple terms it allows you to use one of these functions: require, include, fopen (), file (), readfile () and file_get_contents (), you do not need to enter the full path once you have entered the file name , php will look in the folders within the include_path.

The documentation explanation is below:

"Specifies the list of directories where the require, include, fopen (), file (), readfile (), and file_get_contents () searches for files. The format equals the PATH environment variable: a list of separate directories by comma in Unix and semicolon in Windows.

PHP considers expensive item in include_path separately when looking for files to include. It will check the first path, and if it does not find here, it will look at the next one and so on, until it finds the file or returns a warning or error. You can modify the include_path at runtime using set_include_path (). "

Reference

    
13.03.2017 / 05:50