php - array switch case statement -


i have array coming in sub arrays this

array (     [0] => array         (             [customers] => array                 (                     [id] =>                   )              [products] => array                 (                     [id] =>                   )              [models] => array                 (                     [id] => 151                       [submodels] => array                         (                             [ol] =>                          )                      [noice] =>                  )          ) 

i want make switch statement on array

so this

switch($array){      case products:      case customers:      case models: } 

how that. thanks

since $array holds array within it, looks you'll want @ keys of array indexed @ $array[0]

foreach ($array[0] $key => $value) {     switch ($key) {         case 'products' :             //             break ;         case 'customers' :             //             break ;         case 'models' :             //             break ;      }  } 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -