How to use PHP fgetcsv to create an array for each piece of data in csv file?

Posted by Olivia on Stack Overflow See other posts from Stack Overflow or by Olivia
Published on 2010-05-11T15:40:08Z Indexed on 2010/05/11 15:44 UTC
Read the original article Hit count: 218

Filed under:
|
|
|

I'm trying to import data from a csv file to some html code to use it in a graph I have already coded. I'm trying to use PHP and fgetcsv to create arrays for each separate piece of data to use PHP to put it into the html code. I know how to open the csv file and to print it using PHP, and how to print each separate row, but not each piece of data separated by a comma. Is there a way to do this?

If this helps, this is the csv data I am trying to import.

May 10,72,12,60
May 11,86,24,62
May 12,67,32,34
May 13,87,12,75
May 14,112,23,89
May 17,69,21,48
May 18,98,14,84
May 19,115,18,97
May 20,101,13,88
May 21,107,32,75

I hope that makes sense.

© Stack Overflow or respective owner

Related posts about php

Related posts about csv