Append data to a text file using php
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:
- Appending string using php to a text file
- Store Data In Remote DataBase Using cUrl or Execute a HTTP POST Using PHP CURL
- Write data to a page using javascript
- Text Size Switching Using PHP
- Post Data To Another Website Using cURL In PHP
