I am attemptting to attach a small CMS to a website I am creating. However I have come across a small problem. The CMS uses PHP functions for inserting menus, these PHP func
It appears Topbit already beat me to this, but mine is slightly differs in that it doesn't echo the value straight to the output stream, but saves it in a variable that you may echo at your convenience:
\n";
foreach($arr as $val) {
if (is_array($val)) {
$output .= "- \n" . GenerateMenu($val, $output) . "
\n";
}
else {
$output .= "- " . $val . "
\n";
}
}
$output .= "\n";
return $output;
}
$html = GenerateMenu($menu);
?>
Edit:
Thanks Gumbo and Topbit, now that I'm on my machine with PHP installed, I have tested it and it works fine.