php create file if not exists code example
Example 1: php check if file exists
if (!file_exists('http://mysite.com/images/thumbnail_1286954822.jpg')) {
$filefound = '0';
}
Example 2: laravel create new file if not exists
if (!file_exists('somefile.txt')) {
touch('somefile.txt', strtotime('-1 days'));
}