This is my table which I am displaying using PHP from a CSV file
I want to sort it such that all rows of m1 come first, then a blank line, then m2 and so on.
This is my code which i use to display the CSV file as a table.
<?php
$filename = basename(__FILE__, ".php");
$f = fopen("$filename.csv", "r");
while (($line = fgetcsv($f)) !== false) {
echo "<tr>";
foreach ($line as $cell) {
echo "<td>" . htmlspecialchars($cell) . "</td>";
}
echo "</tr>
";
}
fclose($f);
echo "
</tbody></table></body></html>";
?>