PHP Method to obtain the current directory.
Use getcwd() Function or dirname(FILE)
The code is as follows:
<?php echo getcwd() . "<br/>"; echo dirname(FILE); ?>
The above is the detailed content of Detailed explanation of the php getcwd() function to obtain the directory where the current file is located. For more information, please follow other related articles on the PHP Chinese website!