Using fgetcsv returns an array from the line of the csv file. To see how it exploded, you run your returned array in the print_r () function. To see that as a pretty printed type, you can wrap it in tags<pre>
<?php
if (($handle = fopen("test.csv", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
echo "<pre>".print_r($data)." <br /></pre>";
}
fclose($handle);
}
?>
This should be a good start.
http://php.net/manual/en/function.fgetcsv.php
wajiw source
share