1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Rep Power
    Is there something similar to printf for writing to files? Right now, my code is this

    function PrintEmployees($input_array)
    while(list($index, $value) = each($input_array))
    printf ("%s (%s) %.2f <BR>n",

    But instead of printing to the browser, I want to write the same output to a file. How do I do this? Can it be done with fputs?

  2. #2
  3. Full Access
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jun 2000
    London, UK
    Rep Power
    Yeah, do it with fputs, but you have to do an fopen first to open the file, then an fclose afterwards to close it. Read up on this here


Similar Threads

  1. Writing to two *.csv files
    By CAR in forum Perl Programming
    Replies: 4
    Last Post: February 7th, 2004, 04:39 PM
  2. Trouble writing to text files
    By Haekel in forum ASP Programming
    Replies: 2
    Last Post: February 2nd, 2004, 12:07 PM
  3. C - Writing files to Novell network share
    By gehenna801 in forum C Programming
    Replies: 2
    Last Post: January 7th, 2004, 11:23 AM
  4. reading and writing to files using structs
    By marco-marco in forum C Programming
    Replies: 1
    Last Post: December 25th, 2003, 12:17 PM
  5. problem writing files in script
    By RingWraith112 in forum Perl Programming
    Replies: 16
    Last Post: December 10th, 2003, 07:06 PM

IMN logo majestic logo threadwatch logo seochat tools logo