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

Write to file using php

Wed Jul 25, 2007 2:31 pm

Hi all ,,,

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

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



if (-
1 == 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 : Write to file using php
 File write read     -  
 Read and write CSV file     -  
 Read and Write to file using ASP     -  
 Write Vector list to File     -  
 How to read and write to CSV file from python     -  
 Write and Read to File In Java Example     -  
 Encrypt/Decrypt a file from source file to target file.     -  
 Copy file to file in java code- implementation     -  
 Write a program in C++     -  
 Write to system log     -  

Topic Tags

PHP Files and I/O