Home > Article > Backend Development > PHP gets the directory where the current file is located getcwd() function
Use the getcwd() function or dirname(__FILE__)
<?php echo getcwd() . "<br/>"; echo dirname(__FILE__); ?>
For more PHP articles about getting the directory where the current file is located, please pay attention to the PHP Chinese website for articles related to the getcwd() function!