Creating an array with a file

From: Date: Mon, 11 Feb 2002 17:32:44 +0000
Subject: Creating an array with a file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-84173@lists.php.net to get a copy of this message
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 file 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. Thanks, -Scott

« previous php.general (#84173) next »