Re: Creating an array with a file

From: Date: Sun, 10 Feb 2002 23:00:59 +0000
Subject: Re: Creating an array with a file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-84191@lists.php.net to get a copy of this message
You need to actually read the file in order for this to work. You're just opening it and then printing the file handle... Bogdan Scott wrote: > 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 > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#84191) next »