Spliting from CSV
Posted: Mon Sep 27, 2010 12:05 am
hi,
i have a csv file, the data is something as below:
Here's how i come so far
Thanks
i have a csv file, the data is something as below:
how do i make it into an array?1/19/2010,book_1,14,"67,333",5
2/19/2010,book_2,15,"15,123",6
Here's how i come so far
But it seems that it had split the hits comma value as well... is there any way to ignore the comma inside a double quote?$temp_array = explode("\n",read_file('my.csv'));
foreach($temp_array as $lines){
//echo $lines;
list($date,$booktitle,$id,$total_hits,$price) = explode($lines);
}
Thanks