Current Location: Home> Function Categories> dirname

dirname

Return to the directory part in the path
Name:dirname
Category:File system
Programming Language:php
One-line Description:Returns the directory name part in the path.

Definition and usage

dirname() function returns the directory part in the path.

Example

 <?php
echo dirname ( "c:/testweb/home.php" ) ;
echo dirname ( "/testweb/home.php" ) ;
?>

Output:

 c:/testweb
/testweb

grammar

 dirname ( path )
parameter describe
path Required. Specify the path to be checked.

illustrate

The path parameter is a string containing the full path to a file. This function returns the directory name after removing the file name.

Similar Functions
  • Group of files obtained filegroup

    filegroup

    Groupoffilesobtained
  • Format input from a file fscanf

    fscanf

    Formatinputfromafile
  • All remaining data at the output file pointer fpassthru

    fpassthru

    Allremainingdataatth
  • Get the inode modification time of the file filectime

    filectime

    Gettheinodemodificat
  • Change the current umask umask

    umask

    Changethecurrentumas
  • Create a hard connection link

    link

    Createahardconnectio
  • Write to files (safely used in binary files) fwrite

    fwrite

    Writetofiles(safelyu
  • Close process file pointer pclose

    pclose

    Closeprocessfilepoin
Popular Articles