Hello,
I want to display an array as an HTML ul. I found the following code:
[php]function makeULLI($array) {
$return = “
- \n”;
if (is_array($array) && count($array) > 0) {
foreach ($array as $k => $v) {
if (is_array($v) && count($v) > 0) {
$return .= "\t<li>" . $k . makeULLI($v) . "</li>\n";
}
else {
$return .= "\t<li>" . $v . "</li>\n";
}
}
} else {}
$return .= "</ol>";
return $return;
}[/php]
But when I run this i get:
[b]Fatal error[/b]: Call to undefined function makeulli() in [b]/home/public_html/html_helper.php[/b] on line [b]313[/b]
I am using it in a class.
How can I solve this? Or do you maybe have an other idea how to print an array as an HTML UL?
Thank you,
Bart