fgetcsv: read a csv file : CSV « Development « PHP






fgetcsv: read a csv file


<?php
   $fh = fopen("./demoCSV.csv", "r");
   while (list($name, $email, $phone) = fgetcsv($fh, 1024, ",")) {
      echo "<p>$name ($email) Tel. $phone</p>";
   }
?>


<!--
A,a@example.com,11111
B,b@example.com,22222


-->

           
       








Related examples in the same category

1.Loading table data from a CSV file
2.explode CSV file
3.Read csv file