faqts : Computers : Programming : Languages : PHP : Common Problems : Files : Tips and Tricks

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

5 of 17 people (29%) answered Yes
Recently 3 of 10 people (30%) answered Yes

Entry

I have a text db file using pipe delimiters- what php can be used to extract the email field

Jul 9th, 2003 12:51
Gerhardt, Ken Freeman, http://www.php.net/manual/en/function.fgetcsv.php


Use fgetcsv() to read the file and split it into fields
You can also use a combination of file() and explode(), but fgetcsv is 
probably better on big files.
There's a good example in the manual.
You can also use a combination of file() and explode(), but fgetcsv is 
probably more friendly with your ressources.