Home >Backend Development >PHP Tutorial >Flexible method of obtaining file path through __FILE__
Run results: F:mysitewwwindex.php F:mysitewww F:mysite Remarks: __FILE__, you can get the current path of the file, which will not change even if it is included. It can be used as the absolute path of the website on the server, and other directories will be distributed based on this. |