1
Hello, my friends!
I have this CSV : And this code in PHP:
<?php
// Create a table from a csv file
$area = 0;
echo "<table class=\"table table-hover\">\n\n";
$f = fopen("horarios_modificados.csv", "r", ";");
while (($line = fgetcsv($f)) !== false) {
if($area == 0) echo "<thead>\n";
if($area == 1) echo "<tbody>\n";
$row = $line[0]; // We need to get the actual row (it is the first element in a 1-element array)
$cells = explode(";",$row);
echo "<tr>\n";
foreach ($cells as $cell) {
echo "<td>" . htmlspecialchars($cell) . "</td>\n";
}
echo "</tr>\n";
if($area == 0) echo "</thead>\n";
$area++;
}
fclose($f);
echo "</tbody>\n";
echo "\n</table>\n";
?>
I would like the exclamation point "!" (already inserted in my CSV) is a code in PHP to give new line (line break) in CSV when it’s in php in browser.
'Cause these days it’s like this:
Could you help me?
It worked! I’ve tried it
– Betina Palma