Facebook Twitter Reset

This Tutorial Has Been Viewed 2,970 Times.

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

VN:F [1.9.13_1145]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)
Append data to a text file using php, 10.0 out of 10 based on 1 rating

Incoming search terms:




You will also be interested in ,

No comments yet.

Leave a Comment

Spam protection by WP Captcha-Free

Affordable Seo PackagesSeo BlogEdu Backlinks
More in PHP, scripts (121 of 149 articles)