Home
+ · PHP Scripts
+++ · write data to a text file

write data to a text file

posted in PHP Scripts | on 30.12.2006. 11:18

This php script is a basic simple file read/write script.

  <?php

    $your_data 
"This is the data to be stored in the text file.";

    
// Open the file and erase the contents if any
    
$fp fopen("textfile_name.txt""w");

    
// Write the data to the file
    
fwrite($fp$your_data);

    
// Close the file
    
fclose($fp);

?>