Append data to a text file using php
Posted by admin | Posted in PHP, scripts | Posted on 07-05-2009
0
A simple code that shows how to append data to a flat text file using php
<?php
$File = “myfile.txt”;
$Handle = fopen($File, ‘a’);
$Data = “php\n”;
fwrite($Handle, $Data);
$Data = “mysql\n”;
fwrite($Handle, $Data);
print “Data Added”;
fclose($Handle);
?>
This should add these two names to the end of the file, so our file now contains four names:
php
mysql
Related posts:












