Current Location: Home> Function Categories> realpath

realpath

Returns the normalized absolute path name
Name:realpath
Category:File system
Programming Language:php
One-line Description:Returns the absolute path name.

Definition and usage

realpath() function returns an absolute path.

This function deletes all symbolic connections (such as '/./', '/../' and redundant '/') and returns the absolute pathname.

If it fails, return false. For example, if the file does not exist.

Example

 <?php
echo realpath ( "test.txt" ) ;
?>

Output:

 C:\Inetpub\testweb\test.txt

grammar

 readlink ( linkpath )
parameter describe
linkpath Required. Specify the connection path to be checked.

illustrate

On BSD systems, if linkpaths are just not present, PHP does not return false like other systems.

Similar Functions
  • Find file paths that match patterns glob

    glob

    Findfilepathsthatmat
  • Read characters from file pointer fgetc

    fgetc

    Readcharactersfromfi
  • Get the inode modification time of the file filectime

    filectime

    Gettheinodemodificat
  • Get file modification time filemtime

    filemtime

    Getfilemodificationt
  • Provide information about the document stat

    stat

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

    fwrite

    Writetofiles(safelyu
  • Delete directory rmdir

    rmdir

    Deletedirectory
  • Check if the file or directory exists file_exists

    file_exists

    Checkifthefileordire
Popular Articles