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

    Join Date
    Sep 2000
    Posts
    0
    Rep Power
    0
    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",
    $value[0],
    $value[1],
    $value[2]);
    }
    }

    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?

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

    Join Date
    Jun 2000
    Location
    London, UK
    Posts
    2,019
    Rep Power
    17
    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

    --------------------------------------------
    Alex
    (http://www.alex-greg.co.uk)

Similar Threads

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

IMN logo majestic logo threadwatch logo seochat tools logo