PHP dirname() Function
Complete PHP Filesystem Reference Manual
Definition and Usage
The dirname() function returns the directory name part of a path.
Syntax
dirname(path)
| Parameters | Description |
|---|---|
| path | Required. Specifies the path to check. |
Example
"; echo dirname("/testweb/home.php"); ?>The code above will output:
c:/testweb
/testweb
Complete PHP Filesystem Reference Manual