Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php append file

<?php

$file = 'myFile.txt';
$text = "This is my Text
";
file_put_contents($file, $text, FILE_APPEND | LOCK_EX);

// adds "This is my Text" and a linebreak to the end of "myFile.txt"
// "LOCK_EX" prevents anyone else writing to the file at the same time

?>
Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #php #append #file
ADD COMMENT
Topic
Name
9+2 =