tags:

views:

49

answers:

1
array(2) {
  ["param"]=>
  array(1) {
    ["stuNBR"]=>
    string(5) "555555"
  }
  ["data"]=>
  array(3) {
    [0]=>
    array(6) {
      ["SEQNBR"]=>
      string(1) "2"
      ["CDE"]=>
      string(3) "MUG"
      ["NBR1"]=>
      string(1) "1"
      ["NBR2"]=>
      string(1) "0"
      ["NBR3"]=>
      string(3) "PAN"
      ["NBR4"]=>
      string(1) "Y"
    }
    [1]=>
     array(6) {
      ["SEQNBR"]=>
      string(1) "2"
      ["CDE"]=>
      string(3) "JUG"
      ["NBR1"]=>
      string(1) "1"
      ["NBR2"]=>
      string(1) "0"
      ["NBR3"]=>
      string(3) "RAN"
      ["NBR4"]=>
      string(1) "Y"
    }   
    [2]=>
     array(6) {
      ["SEQNBR"]=>
      string(1) "2"
      ["CDE"]=>
      string(3) "GHY"
      ["NBR1"]=>
      string(1) "1"
      ["NBR2"]=>
      string(1) "0"
      ["NBR3"]=>
      string(3) "PAN"
      ["NBR4"]=>
      string(1) "Y"
    }
   }
}

How do iterate through the "data" array from above and get the NBR1 and NBR2 values

foreach ($this->bigarray['DEFAULTS'] as $data){
   echo $data['NBR1']."---->".$data['NBR2'];
}

How do i get those values

+6  A: 

You can use a nested loop:

foreach ($this->bigarray['data'] as $data){
   foreach($data as $k => $v) {
      echo $k."---->".$v;
   }
}
Jacob Relkin