English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP Filesystem Reference Manual
The dirname() function can return the directory name from a path.
string dirname ( string path )
<?php echo dirname("C:/PhpProject/index.php") . "\n"; echo dirname("/PhpProject/index.php"); ?>
Output Result
C:/PhpProject /PhpProject