<?php class ClasseLec { static function lireCSV($fichierCSV) { $fh = fopen($fichierCSV, 'rb'); if (! $fh) { die("Impossible d'ouvrir $fichierCSV: $php_errormsg"); } print "<table>"; for ($line = fgetcsv($fh, 1024); ! feof($fh); $line = fgetcsv($fh, 1024)) { print '<tr><td>' . implode('</td><td>', $line) . "</td></tr> "; } print '</table>'; } } ClasseLec::lireCSV("fichier.csv"); ?>