Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP file_exists() Function

PHP file_exists() Function


PHP Filesystem Reference Manual Complete PHP Filesystem Reference Manual


Definition and Usage

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

Returns TRUE if the specified file or directory exists, FALSE otherwise.

Syntax

file_exists(path)

Parameters Description
path Required. Specifies the path to check.

Example

The code above will output:

1


PHP Filesystem Reference Manual Complete PHP Filesystem Reference Manual