fgetcsv

It returns line from file pointer and parse for CSV fields

Example

<?php

$filename = “test.csv”;

echo “<table border=’1′>”;

if (($handle = fopen($filename, “r”)) !== FALSE) {

while (($data = fgetcsv($handle, 1000, “,”)) !== FALSE){ ?>

<tr><?php foreach($data as $values) {?><td > <?php echo $values ?></td><?php } ?></tr>

<?php }

}

echo “</table>”;

?>

Share