Current Location: Home> Function Categories> file_exists

file_exists

Check if the file or directory exists
Name:file_exists
Category:File system
Programming Language:php
One-line Description:Check if the file or directory exists.

Definition and usage

file_exists() function checks whether a file or directory exists.

Return true if the specified file or directory exists, otherwise return false.

Example

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

Output:

 1

grammar

 file_exists ( path )
parameter Description
path Required. Specify the path to be checked.
Similar Functions
  • Delete directory rmdir

    rmdir

    Deletedirectory
  • Clear file status cache clearstatcache

    clearstatcache

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

    fwrite

    Writetofiles(safelyu
  • Returns the normalized absolute path name realpath

    realpath

    Returnsthenormalized
  • Create a file with a unique file name tempnam

    tempnam

    Createafilewithauniq
  • Positioning in file pointer fseek

    fseek

    Positioninginfilepoi
  • Find file paths that match patterns glob

    glob

    Findfilepathsthatmat
  • Change file mode chmod

    chmod

    Changefilemode
Popular Articles