# Solved: PHP - From CSV to Multidimensional Array



## cc64 (Dec 21, 2007)

Hello TSG!

I have a CSV file with 5 attributes and 6 rows. I want to throw that structure into a two dimensional array. I have a found a few topics around the web that don't seem to work. (Which made me question why I went anywhere BUT TSG.) Ideas?

Thanks for any help. 
Curtis


----------



## cc64 (Dec 21, 2007)

I will mark this solved, but for those curious, here is how I solved it:


```
if (($handle = fopen("slider.csv", "r")) !== FALSE)
           {
                while(($data = fgetcsv($handle,1000,",")) !==FALSE)
                {
                     array_push($slideattrs, array($data[0], $data[1], $data[2], $data[3], $data[4]));
                {
           {
```
$slideattrs was declared array() at the beginning.


----------

