I have a array called $menu_array; and currently looks like this
[0] => Array
(
[id_parent_menu] => 4
[parent_info] => test
[children_menu] => Array
(
[0] => Array
(
[id_child_menu] => 21
[children_info] => test
)
[1] => Array
(
[id_child_menu] => 22
[children_info] => test2.
)
)
)
and so on.
I also have another array $access that looks like this:
array(
[4]='true'
[22]='true'
)
What I’m trying to do is check to see if the key for the $access array exists as a id_parent_menu, and then put a key and value of
$menu_array[can_view]='true';
Then, also check if inside the $children_menu array inside of the $menu_array if the a $access key exists as a id_child_menu and set a value of can_view = true in there too.
$menu_array['children_menu'][1]['can_view']='true';
(A child item can be visible only if the parent item is visible.)