Question : php create file if not exist
Answered by : nadim-al-abdou
<?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.
}
?>
Source : https://stackoverflow.com/questions/20580017/php-create-a-file-if-not-exists | Last Update : Thu, 24 Jun 21