The path of _ file _ is the file where the current code is located.
Dirname (_ file _); the directory name at the top of the file is obtained.
Dirname (_ file _); the directory name of the file's layer is obtained.
"../" Is suitable for a simple file containing another file. Most dirname (_ file _) is suitable for multiple layers, more complex file inclusion, and easier maintenance. If only the. php file contains the B. php file, you can directly use the dirname (_ file _) or "../" of the include file. Generally, no error occurs. But usually a contains B files, and C. if PHP contains file a, use ".. /", it will cause the path error when C contains a and then loads B files, and when dirname (_ file _) is used, when C contains a, It maps the path relationship between C and A with dirname (_ file,
When file a contains file B, the corresponding directory relationship between file a and file B is mapped using dirname (_ file. This will not cause path errors when different directories are included for multiple times! Note _ file __indicates the file name of the file where the code is located. For example, if C uses dirname (_ file _) to contain a, the _ file _ code is a C file, when C contains a and dirname (_ file _) is used to include B,
Then _ file _ is the file during execution, and so on. The file inclusion and path will never go wrong!
The path of _ file _ is the file where the current code is located.
Dirname (_ file _); the directory name at the top of the file is obtained.
Dirname (_ file _); the directory name of the file's layer is obtained.
"../" Is suitable for a simple file containing another file. Most dirname (_ file _) is suitable for multiple layers, more complex file inclusion, and easier maintenance. If only the. php file contains the B. php file, you can directly use the dirname (_ file _) or "../" of the include file. Generally, no error occurs. But usually a contains B files, and C. if PHP contains file a, use ".. /", it will cause the path error when C contains a and then loads B files, and when dirname (_ file _) is used, when C contains a, It maps the path relationship between C and A with dirname (_ file,
When file a contains file B, the corresponding directory relationship between file a and file B is mapped using dirname (_ file. This will not cause path errors when different directories are included for multiple times! Note _ file __indicates the file name of the file where the code is located. For example, if C uses dirname (_ file _) to contain a, the _ file _ code is a C file, when C contains a and dirname (_ file _) is used to include B,
Then _ file _ is the file during execution, and so on. The file inclusion and path will never go wrong!