I use framewokr Yii2 . How can I get the value of the elements from this array, if I'm not mistaken, this is a multidimensional associative array.

How to get the value of the key 'label' for example

[ 'options' => ['class' => 'navbar-nav navbar-right'], 'items' => [ ['label' => 'Home', 'url' => ['/site/index']], ['label' => 'About', 'url' => ['/site/about']], ['label' => 'Contact', 'url' => ['/site/contact']], Yii::$app->user->isGuest ? ['label' => 'Login', 'url' => ['/site/login']] : [ 'label' => 'Logout (' . Yii::$app->user->identity->username . ')', 'url' => ['/site/logout'], 'linkOptions' => ['data-method' => 'post'] ], ], ] 
  • 2
    $array['items'][$i]['label'] - and isn’t it taken? - splash58
  • @ splash58 In! Super, thanks! - Yuri Svetlov
  • @ splash58 So this array is not just associative, it also has an LLC array .... And how are such arrays called mixed? - Yuri Svetlov
  • one
    I do not know if they are called somehow, the php array is always a scary structure :) - splash58

0