title: Traverse multi dimensional array recursively without using foreach
body: <p>I have an array like this and the code using foreach loop.</p>
  
  <pre><code>$arr = array( array ( array( 'CAR_TIR', 'Tires', 100 ),
             array( 'CAR_OIL', 'Oil', 10 ),
             array( 'CAR_SPK', 'Spark Plugs', 4 )
            ),
         array ( array( 'VAN_TIR', 'Tires', 120 ),
             array( 'VAN_OIL', 'Oil', 12 ),
             array( 'VAN_SPK', 'Spark Plugs', 5 )
            ),
         array ( array( 'TRK_TIR', 'Tires', 150 ),
             array( 'TRK_OIL', 'Oil', 15 ),
             array( 'TRK_SPK', 'Spark Plugs', 6 )
            )
        );
  
  
  function recarray($array)
  {
      foreach($array as $key=&gt;$value)
      {
          if(is_array($value))
          {
              RecArray($value);
          }
          else
          {
              echo "key = $key value = $value";
         }
      }
  }
  recarray($arr);
  </code></pre>
  
  <p>I have to traverse the array using recursion and without using foreach.</p>