Write data to a file using php

Print

To add a data to a text or any other file using php use the following code:

<?php

$file=fopen('file.txt','a+');
fwrite($file,"text to be added");
fclose($file);

?>

Last Updated ( Friday, 02 January 2009 16:21 )