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";
}
?>
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";
}
?>
php create file if not exist
<?php
$file = 'test.txt';
if(!is_file($file)){
$contents = 'This is a test!'; // Some simple example content.
file_put_contents($file, $contents); // Save our content to the file.
}
?>
laravel create new file if not exists
if (!file_exists('somefile.txt')) {
touch('somefile.txt', strtotime('-1 days'));
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us