Question

Reply

Join Date: Nov 2007
Posts: 68
Reputation: jencinas69 is an unknown quantity at this point 
Solved Threads: 1
jencinas69's Avatar
jencinas69 jencinas69 is offline Offline
Junior Poster in Training

Question

 
0
  #1
Sep 9th, 2008
I have this code
  1. <?php
  2.  
  3. error_reporting(E_ALL ^ E_NOTICE);
  4. ini_set("display_errors", true);
  5.  
  6. $file = "pets_feed_" . date("Ymd") . ".txt";// - for yyyymmdd
  7.  
  8. if (!file_exists($file)) touch($file);
  9.  
  10. $fh = fopen($file, "r");
  11.  
  12. $fcontent = @fread($fh, filesize($file));
  13.  
  14. $towrite = "ID Category Description"."\n";
  15.  
  16.  
  17. $fh22 = fopen($file, 'w+');
  18.  
  19. fwrite($fh22, $towrite . $fcontent );
  20.  
  21. fclose($fh);
  22.  
  23. fclose($fh22);
  24.  
  25. ?>

What it does is that Creates a new file and writes ID Category Description on top
but I also need to read anothe file in my server and write the content on that file into the new file I am creating

Any help

Thank you
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC