![]() |
|
|
|||||||
![]() |
|
|
Thread Tools | Rate Thread |
|
|
PM User | #1 |
|
New Coder ![]() Join Date: May 2009
Location: Pennsylvania, United States
Posts: 19
Thanks: 5
Thanked 0 Times in 0 Posts
![]() |
Split CSV row
I'm experimenting with flat files.
I have this file, it looks like this: 1,John Doe,"Hello world!" 2,Jane Doe,"Hello, John!" My question is how could I "split" each row into 3 seperate fields Here's what I have so far: $db = file('db.txt'); foreach($db as $row) { list($id, $name, $msg) = explode(",", $row); } However, the explode() is not working, any ideas? |
|
|
|
|
|
PM User | #3 | |
|
New Coder ![]() Join Date: Nov 2009
Location: Australia
Posts: 43
Thanks: 0
Thanked 5 Times in 5 Posts
![]() |
Quote:
__________________
Professional Banner Design @ goodbanners.com Free Web Banner Design @ WebBannerMaker.com |
|
|
|
|
![]() |
| Bookmarks |
| Tags |
| csv, database, explode |
| Thread Tools | |
| Rate This Thread | |
|
|