dirname
Return to the directory part in the path
dirname()
function returns the directory part in the path.
<?php echo dirname ( "c:/testweb/home.php" ) ; echo dirname ( "/testweb/home.php" ) ; ?>
Output:
c:/testweb /testweb
dirname ( path )
parameter | describe |
---|---|
path | Required. Specify the path to be checked. |
The path parameter is a string containing the full path to a file. This function returns the directory name after removing the file name.