To check if a file exists or not
file_exists(string filename)
filename->To specify the full path of the file
Function returns ‘true’ if the file exist in the specified path, otherwise it will returns ‘false’.
<?php
$filename = ‘/optional/file_path/file_name.txt’;
if (file_exists($filename)) {
echo “File Exists”;
} else {
echo “File does not Exist”;
}
?>