file_exists

file_exists

bool file_exists ( string filename )

The function file_exists() checks whether a file or a directory exists

It returns TRUE if the file given in the string format exist and FALSE
if it doesnt

<?php

$filename = ‘/path/user/images/new.gif’;

if (file_exists($filename)) {
echo “The file $filename exists”;
} else {
echo “The file $filename does not exist”;
}

?>

Leave a Reply


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.