Answers for "php check if a file existis if not create t"

PHP
1

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.
}

?>
Posted by: Guest on June-17-2021

Code answers related to "php check if a file existis if not create t"

Browse Popular Code Answers by Language