Home  >  Article  >  Backend Development  >  How to check the path of php file

How to check the path of php file

藏色散人
藏色散人Original
2019-09-29 10:25:183920browse

How to check the path of php file

How to check the path of php file?

__FILE__ means the absolute path of the current file including the file name, dirname (__FILE__) represents the absolute path of the current file.

dirname(__FILE___) function returns the path where the script is located.

For example, the file b.php contains the following content:

If b.php is referenced by the a.php file require or include in other directories.

The content of the variable $basedir is still the path to the folder where b.php is located.

Instead of becoming the directory where the a.php file is located.

For more PHP related knowledge, please visit PHP Tutorial!

The above is the detailed content of How to check the path of php file. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Is php multi-process?Next article:Is php multi-process?