[thelist] Reading a tab delimited file with php

Michael Kimsal michael at tapinternet.com
Mon Aug 19 21:44:00 CDT 2002


CDitty wrote:

> Does anyone have any code examples on how to read and handle a tab
> delimited using PHP?  I can a comma delimited one, but I can't get the
> tab
> delimited to read right.
>
> Anyone?
>
> Chris
>
fgetcsv will parse any incoming line of data into an array based on
whatever
delimeter you ask it to.  \t = tab

$f = fopen("file","r");
while($array = fgetcsv($f,5000,"\t")) {
// do something with the $array array
}
fclose($f);


Michael Kimsal
http://www.logicreate.com/
734-480-9961




More information about the thelist mailing list