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

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

高洛峰
Release: 2023-03-04 16:24:01
Original
1370 people have browsed it

Use the getcwd() function or dirname(__FILE__)

<?php 
echo getcwd() . "<br/>"; 
echo dirname(__FILE__); 
?>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template