PHP file_exists() Function

The file_exists() function checks whether or not a file or directory exists.This function returns TRUE if the file or directory exists, otherwise it returns FALSE.

bool file_exists ( string $filename )

Checks whether a file or directory exists.

Example -

ParameterDescription
pathRequired. Specifies the path to check

Note -

Because PHP's integer type is signed and many platforms use 32bit integers, some filesystem functions may return unexpected results for files which are larger than 2GB.