I will now profess my undying love for php. I have a project at work where I have to read a CSV file into an array. I thought it was going to take an endless amount of time to try and figure out how to do that. But PHP has done it all for me with this function fgetcsv and shows how it works with this snippet. Read and print the entire contents of a CSV file
<?php
$row = 1;
$handle = fopen ("test.csv","r");
while ($data = fgetcsv ($handle, 1000, ",")) {
$num = count ($data);
print "<p> $num fields in line $row: <br>\n";
$row++;
for ($c=0; $c < $num; $c++) {
print $data[$c] . "<br>\n";
}
}
fclose ($handle);
?>
*smooch*