Problem Statement
How can you check if a file exists before reading it?
Explanation
The file_exists function checks if a given path refers to an existing file or directory and returns true or false.
Code Solution
SolutionRead Only
if(file_exists('data.txt')) { echo 'Found'; }