How do I read a tab delimited file?
| From: | Don | Date: | Tue, 12 Mar 2002 04:50:58 +0000 |
| Subject: | How do I read a tab delimited file? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-88150@lists.php.net to get a copy of this message | ||
Hi,
I have a tab delimited file consisting of several lines, one record per line that I have to process.
I don't see a function similar to "fgetcsv" for TABS so I've used the
"file" function to read the whole file into an array, one line per array element. So far
so good.
Now I have to process each line and extract the fields. My question is, how do I search for the TAB
character? Is it as simple as searching on the ascii code by using the "chr" function?
If so, what value do I use in "chr" to look for TAB?
Thanks,
Don