I want to traverse this array and display, \'comment\' as bullet points.
Array
(
[1] => Array
(
[id] => 1
[comment]
You need a little bit of recursion
function traverse_array($array)
{
echo '';
foreach($array as $element)
{
echo '- ';
if(isset($element['comment']))
{
echo $element['comment'];
}
if(is_array($element['children']) && count($element['children']) > 0)
{
traverse_array($element['children']);
}
echo '
';
}
echo '
';
}
traverse_array($the_big_array);