create a text file if not exists in php code example
Example: laravel create new file if not exists
if (!file_exists('somefile.txt')) {
touch('somefile.txt', strtotime('-1 days'));
}
if (!file_exists('somefile.txt')) {
touch('somefile.txt', strtotime('-1 days'));
}