All Dictionaries
PHP Related dictionaries
php dirname() function
Detailed instructions for use
php dirname() function
Chinese translation
Recent Updates: 2018-04-19 13:49:53
Directory name; return the directory part of the path; directory name
php dirname() function syntax
Function: Return the directory part of the path.
Syntax: dirname(path)
Parameters:
| Parameter | Description |
| path | Required. Specifies the path to be checked. |
Explanation: The path parameter is a string containing the full path to a file. This function returns the directory name after removing the file name.
php dirname() function example
<?php $file = "/phpstudy/WWW/index.php"; echo dirname($file); ?>
Run instance»
Click the "Run instance" button to view the online instance
Output:
/phpstudy/WWW




