#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Sacramento
    Posts
    50
    Rep Power
    15
    Does php have a function to export data to a text file in a tab delimited format for example?

    Thanks!
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Seattle, WA USA
    Posts
    23
    Rep Power
    0
    Use fopen() to open a file...
    Use fput() to write to a file...


    Here is a quick sample:

    // Open a file for writing
    $FileName = "mytest.txt";
    $Delimiter = "~"

    $MyFile = fopen($FileName,"w");

    // Loop through an array or recordset
    $Line = "Name".$Delimiter."Title".$Delimiter."Age";
    fputs($MyFile,$Line);

    // End Loop

    fclose($MyFile);


    Hope that helps,

    Carl

Similar Threads

  1. load data infile PHP parse error
    By georgeatef in forum PHP Development
    Replies: 3
    Last Post: June 8th, 2004, 11:07 PM
  2. Getting data from different tables in Mysql with PHP
    By Bosw8er in forum PHP Development
    Replies: 3
    Last Post: February 10th, 2004, 04:25 PM
  3. Inserting data into forms with PHP?
    By Methias in forum PHP Development
    Replies: 1
    Last Post: January 30th, 2004, 12:37 AM
  4. How to show BLOB image data from PHP
    By celebx in forum PHP Development
    Replies: 1
    Last Post: January 28th, 2004, 02:05 PM
  5. php wont output mysql data
    By tanjafei in forum PHP Development
    Replies: 1
    Last Post: January 27th, 2004, 08:40 PM

IMN logo majestic logo threadwatch logo seochat tools logo