Search
 
SCRIPT & CODE EXAMPLE
 

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

?>
Comment

PREVIOUS NEXT
Code Example
Php :: php if no imagee exists 
Php :: get random posts wordpress 
Php :: wordpress if thumbnail show else 
Php :: php function to remove underscore 
Php :: magento 2 composer install 
Php :: hex to dec php 
Php :: how to find datatype of a variable in php 
Php :: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (SQL: alter table `users` add unique `users_email_unique`(`email`)) 
Php :: php call parent constructor 
Php :: php remove cookie 
Php :: add a year php 
Php :: how to populate dropdown list with array values in php 
Php :: laravel request all except 
Php :: laravel has table 
Php :: link acf 
Php :: php artisan clear 
Php :: laravel env pgsql 
Php :: php 3 digit decimal 
Php :: how get last item in foreach in laravel 
Php :: check if text exists in string php 
Php :: random number generator in php 
Php :: generate autodump laravel 
Php :: phpmailer add reply to 
Php :: php get only numbers 
Php :: php get current url without filename 
Php :: home url wordpress 
Php :: php open url 
Php :: laravel withtrashed 
Php :: php get first character of string 
Php :: how to delete image from aws using laravel 8 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =