I have a variable $boo that contains lines of plain text like (with singular line breaks):
a
b
c
I want a function to format it into a bullet list. Have come up with the following, but can't quiet get anything to output:
<?php
function listformat ($list) {
$listformat = explode("
", $listformat);
foreach ($listformat as $test => $line) {
return "<li>".$line."</li>";
};
};
?>
<ul>
<?php
listformat ($boo);
?>
</ul>
It works if I use echo in place of "return" and remove the function.