The dirname() function returns the directory name portion of the path.
dirname(path)
| parameter | describe |
|---|---|
| path | Required. Specifies the path to be checked. |
<?phpecho dirname("c:/testweb/home.php") . "<br />";echo dirname("/testweb/home.php");?>The above code will output:
c:/testweb/testweb