Click to See Complete Forum and Search --> : Parsing a File


BrutusUnix
08-21-2008, 03:01 PM
I'm trying to parse a file using | as a separator.
Also reading each line differently.

Example:
|fname|lname|date
|sex|age|phone|job
|address|.....


Thanks!!!


http://www.BSDWorld.NET/ (http://www.BSDWorld.NET/forums/)

Dok
08-21-2008, 04:24 PM
Doh!...wrong thread. Sorry about that.

SyCo
08-21-2008, 06:01 PM
file() (http://us3.php.net/manual/en/function.file.php)will read each line of the file into an array which you can then foreach() (http://us3.php.net/manual/en/control-structures.foreach.php) and explode() (http://us3.php.net/manual/en/function.explode.php) on the |

Dok I guess it was !2b :)