I don't /really/ follow what youre doing. But I'll try.
You have (For example here) 1 variable with menus:
$menu_name = array(menu1,menu2);
and then 2 more arrays
$menu1_array = array(home, contact);
$menu2_array = array(sub1, sub2);
and you wanna make a dynamic menu? So, variable variables again, I guess. I hate this fuckers.