Append Text to File using PHP

fopen & fwrite functions

<?php

$filename = 'test.txt';

$fp = fopen($filename, 'ab');
fwrite($fp, 'Hello'.PHP_EOL);
fclose($fp);

Leave a Comment

Cancel reply

Your email address will not be published.