php check if file exists
snippet in php

php file exist

user5701

<?php
$filename = '/path/to/foo.txt';

if (file_exists($filename)) {
    echo "The file $filename exists";
} else {
    echo "The file $filename does not exist";
}
?>

file exist php

user7836

if (file_exists($filePath)) {
  // todo acction
}

php check if file exists

user3795

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

file exist php

user8345

file_exists ( string $filename ) : bool