|
split text up into different rows and insert into an html table
split text up into different rows and insert into an html table
<?php
$text = <<<EOD
This is some
sample text,
we want to make
appear in multiple
rows in a table
EOD;
$lines = explode("\n", $text);
echo "<table>";
foreach ($lines as $line)
{
echo "<tr><td>$line</td></tr>";
}
echo "</table>";
?>
|