I\'m working on a simple CMS for a pet project. I currently have a JSON string that contains a list of page ID\'s and Parent page ID\'s for a menu structure.
I want to n
I have found that i have to fix or simplify almost every of the functions above. So here i came with something simple and working, still recursion.
function build_list($array) {
$list = '';
foreach($array as $key => $value) {
if (is_array($value)) {
$list .= "$key: " . build_list($value);
} else {
$list .= "- $key: $value
";
}
}
$list .= '
';
return $list;
}
build_list(json_encode($json_string),true);