Check If .php File Exists Code Example


Example 1: php file exist

<?php $filename = '/path/to/foo.txt';  if (file_exists($filename)) {     echo "The file $filename exists"; } else {     echo "The file $filename does not exist"; } ?>

Example 2: php check if file exists

if (!file_exists('http://mysite.com/images/thumbnail_1286954822.jpg')) {    $filefound = '0';                          }

Comments

Popular posts from this blog

Chemistry - Bond Angles In NH3 And NCl3

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?