0

How do I Store an Array Variable Inside of Another Array Variable using while loop and for each?

Like this(array inside array)

Jigu
  • 11
  • 2

2 Answers2

1

please chec Foreach for arrays inside of an array

foreach($resultArray as $row => $innerArray){
  foreach($innerArray as $innerRow => $value){
    echo $value . "<br/>";
  }
}

also check this link : Foreach for arrays inside of an array

Hardik Chapla
  • 435
  • 6
  • 26
0

You are probably looking for

   <?php
    $format = array('Roman' =>  array('one'=>'I','two'=>'II'),
    'Arbic' =>  array('one'=>'1','two'=>'2'));
    while (list($key, $value) = each($format)) {
           echo $value;
    foreach( $key as $key1 => $value1)   {
    echo $key1 .'='.$value1;
    }

    ?>

I have not tested .

Suraj Khanra
  • 480
  • 1
  • 5
  • 23