Switch to full style
Dynamic open source server-side web development
Post a reply

Append to file using php

Thu Jul 26, 2007 8:47 am

Append to a file in PHP code:

This is the code for appending data into text file using php
Code:
<?

$myname
="DATA TO WRITE";
$fh fopen("f.txt"'a') or die("Can't open $file for writing: $php_errormsg");


 
if (-
== fwrite($fh$myname)) { die("Can't write to $file:
$php_errormsg"
); }
fclose($fh) or die("Can't close $file: $php_errormsg");



?>




Post a reply
  Related Posts  to : Append to file using php
 append,prepend,add after and add before     -  
 Append string in C++     -  
 stream filter to append     -  
 Encrypt/Decrypt a file from source file to target file.     -  
 Copy file to file in java code- implementation     -  
 file descriptor vs file pointer     -  
 getting file name of html input file tag using jsp     -  
 How to convert xml file to Pdf file using C     -  
 C++ File I/O     -  
 web.xml file     -  

Topic Tags

PHP Files and I/O