[Solved] I have an array of dynamic data, how to display that with ordered list as mega menu


Couple of foreach loops should do the trick:

<?php

$arr = array(
 'properties' => array(
     0 => array(
         'sub' => 'hello'
        ),
     1 => array(
         'sub' => 'world'
        )
    ),
  'cars' => array(
     0 => array(
         'sub' => 'hello1'
        ),
     1 => array(
         'sub' => 'world2'
        )
    )
);

print_r($arr);

echo '<ul>';

foreach ($arr as $key => $value) {

    echo '<li>' . $key . '</li>';
    echo '<ul>';

    foreach ($value as $item) {
        echo '<li>' . $item['sub'] . '</li>';
    }

    echo '</ul>';

}

echo '</ul>';

2

solved I have an array of dynamic data, how to display that with ordered list as mega menu