PHP is_file() Function

The is_file() function checks whether the specified file is a regular file.

bool is_file ( string $filename )

Tells whether the given file is a regular file.

Return Values

Returns TRUE if the filename exists and is a regular file, FALSE otherwise.

Example -

The above example will output : -

bool(true)
bool(false)

ParameterDescription
fileRequired. Specifies the open file to check