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.
file_exists(path)
Parameter | Description |
---|---|
path | Required. Specifies the path to the file or directory to check |
Given below example check whether a file exists:
Output : 1