Check A File Exists

Description: Use PHP to check if a file exists or not.

<?PHP
 
$filename = 'test.csv';
IF (FILE_EXISTS($filename))
{
PRINT "The file $filename exists";
}
ELSE
{
PRINT "The file $filename does not exist";
}
 
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.