I have a csv file which contains 2 sheets inside. I am trying to execute the csv file and convert it into a html table using php. but it is taking and displaying table of just one sheet. I am unable to find the other sheet's information.
For this I am using the following code,
<?php
echo "<table border='1' align='center' width='70%'>
";
$f = fopen("../uploads/docs/test.csv", "r");
while (($line = fgetcsv($f)) !== false) {
echo "<tr>";
foreach ($line as $cell) {
echo "<td>" . htmlspecialchars($cell) . "</td>";
}
echo "</tr>
";
}
fclose($f);
echo "
</table><br>";
echo "<table border='1' align='center' width='70%'>
";
$f = fopen("../uploads/docs/testing.csv", "r");
while (($line = fgetcsv($f)) !== false) {
echo "<tr>";
foreach ($line as $cell) {
echo "<td>" . htmlspecialchars($cell) . "</td>";
}
echo "</tr>
";
}
fclose($f);
echo "
</table>";
?>
Please help me by which i can parse csv having multiple sheets in it to a html table