Home  >  Article  >  Backend Development  >  PHP gets the directory where the current file is located getcwd() function

PHP gets the directory where the current file is located getcwd() function

高洛峰
高洛峰Original
2017-01-06 14:50:351325browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn