Php developers need to do a lot of file operations , Work like cache building, logs etc all required file operations functions in php.
www.php.net/file_exists is a handy tool for existing file on to the webserver.
here’s a example code:-
[php]
< ?php
$file = ‘/path/foo.txt’;
if (file_exists($file)) {
echo "$file exists";
} else {
echo "$file does not exist";
}
?>
[/php]
This Functions returns TRUE if the file or directory specified by the filename exists otherwise it retuns FALSE .