Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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

?>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #create #file #exist
ADD COMMENT
Topic
Name
4+6 =