<!DOCTYPE html>
<html>
<body>
<center>
<h1>DISPLAY DATA PRESENT IN CSV</h1>
<h3>Student data</h3>
<?php
echo "<html><body><center><table>
";
// Open a file
$file = fopen("a.csv", "r");
// Fetching data from csv file row by row
while (($data = fgetcsv($file)) !== false) {
// HTML tag for placing in row format
echo "<tr>";
foreach ($data as $i) {
echo "<td>" . htmlspecialchars($i)
. "</td>";
}
echo "</tr>
";
}
// Closing the file
fclose($file);
echo "
</table></center></body></html>";
?>
</center>
</body>
</html>