Home >> Snippet List >> Snippet

Name
Check if a file exists
Description
Use PHP to check if a file exists or not
PHP Snippet
<?PHP
 
$filename = 'test.csv'; 
 
IF (FILE_EXISTS($filename)){
 
PRINT "The file $filename exists";
 
}ELSE{
 
PRINT "The file $filename does not exist";
 
}
 
?>