Checking the existence of a file : file_exists « File Directory « PHP
- PHP
- File Directory
- file_exists
Checking the existence of a file
if (file_exists('/usr/local/htdocs/index.html')) {
print "Index file is there.";
} else {
print "No index file in /usr/local/htdocs.";
}
Related examples in the same category