It is usually very effective to use dirname(__FILE__) when configuring the file path. However, because the path of __FILE__ is the full path of the file where the current code is located (not the file where the URL is located), the defined configuration file is usually placed in the root directory. Define the root address of the website, but the following method can solve the problem of storing the configuration file.
dirname(dirname(__FILE__)); /*
Assume __FILE__ is /home/web/config/config.php
The output of the above method is /home/web
*/
dirname(dirname(__FILE__)); Get is the directory name above the file
dirname(__FILE__); is the directory name above the file
The above has introduced the dirname_file_ explanation of nina and her very long hair in PHP, including the content of nina and her very long hair. I hope it will be helpful to friends who are interested in PHP tutorials.