PHP file_exists() Function

PHP file_exists Function


Definition :

The file_exists method check whether a file or directory exists or not. It accepts the path of the file or directory to be checked as the parameter.

Syntax

   file_exists(path)

Parameter 

Parameter Description
path Required. Specifies the path to the file or directory to check

Given below example check whether a file exists:

Output : 1