Nevermind, I was able to figure it out using:

$myfile = file("oldfile.txt");
for ($s=0; $s<=count($myfile)-1; $s++) {
    $fields = split("\t",$myfile[$s]);

-----Original Message-----
From: Scott [mailto:[EMAIL PROTECTED]] 
Sent: Monday, February 11, 2002 12:33 PM
Subject: [PHP] Creating an array with a file

Hi All,

I am trying to create an array from a text file that I will process and
rewrite in a new format.  My question is, is it possible to read the
in one line at a time and then separate the tab-delimited fields and
finally rewrite the new file?

The fields are tab delimited and here is what I have attempted in code:

$lines = fopen("oldfile.txt", "r");
$newfields = explode("\t", $lines);
echo $newquotes[0];

I get a Resource ID #1 when I echo the line.  



PHP General Mailing List (
To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to