Q:

correct way to display 3 dimensional array with key and value php

I have a 3 dimensional array defined like:
$seccc  =  array(   
                                array( 
                                        "Href"      => base_url().'capture/',   
                                        "Icono"     => base_url().'assets/images/icon_home.png', 
                                        "Texto"     => 'Captura',
                                        "Submenu"   => array(1,2,3)
                                    ),
                                array( 
                                        "Href"      => base_url().'seg/',   
                                        "Icono"     => base_url().'assets/images/icon_tra.png', 
                                        "Texto"     => 'Seg',
                                        "Submenu"   => array('ALFA','OMEGAL','DELTA')
                                    ),
                                array( 
                                        "Href"      => base_url().'usr/',   
                                        "Icono"     => base_url().'assets/images/icon_users.png', 
                                        "Texto"     => 'Users',
                                        "Submenu"   => ''
                                    ),  
                                array( 
                                        "Href"      => base_url().'clients/',   
                                        "Icono"     => base_url().'assets/images/icono_gro.png', 
                                        "Texto"     => 'Clients',
                                        "Submenu"   => ''
                                    ),
                                array( 
                                        "Href"      => base_url().'suc/',   
                                        "Icono"     => base_url().'assets/images/icupo.png', 
                                        "Texto"     => 'Suc',
                                        "Submenu"   => ''
                                    )
                            );

I am doing foreach loop like 
foreach ($seccc  as $part)
    {
        foreach ($part as $item)
        {
            echo '<li>'.$item["Href"];
            if(is_array($item["Submenu"]))
            {
               foreach($item["Submenu"] as $subkey)
               {
                echo '<ul>';
                echo $subkey;                
                echo '</ul>';
               }                    
            }
        }
        echo '</li>';            
        }
    }

However I can not access to "Href", "Icono", "Texto" or "Submenu" items, How to access their values
seems $item["Href"] does not work

A:

foreach ($seccc as $part)
{
    // use $part instead of $item, here you can get $part['Icono'], $part['Texto'] etc
    echo '<li>'.$part["Href"]; 
    if(is_array($part["Submenu"])) 
    {
        // loop over $part['Submenu'] if it's an array
        foreach($part["Submenu"] as $key => $subkey)
        {
            echo '<ul>';
            echo $subkey;                
            echo '</ul>';
        }                    
    }
    echo '</li>';            
}

