php create navigation menu from multidimensional array dynamically

后端 未结 4 548
夕颜
夕颜 2021-01-01 07:38

I did research on this, and wasn\'t able to find an exact answer. Most of the questions/answers on here pertaining to this seem to be unfinished. If anyone knows of a fini

4条回答
  •  一生所求
    2021-01-01 07:49

    Calvin's solution worked for me. Here's the edited version. We can use more nested loops to get sub - sub menu items.

    echo '
      '; foreach ($menu as $parent) { echo '
    • ' . $parent . ''; if (is_array($parent)) { echo ''; } echo '';

提交回复
热议问题