title: PHP - 2D Arrays - Looping through array keys and retrieving their values?
body: <p>I have an array that outputs like this:</p>
  
  <pre><code>1 =&gt; 
  array
    'quantity' =&gt; string '2' (length=1)
    'total' =&gt; string '187.90' (length=6)
  
  2 =&gt; 
  array
    'quantity' =&gt; string '2' (length=1)
    'total' =&gt; string '2,349.90' (length=8)
  </code></pre>
  
  <p>I would like to loop through each array keys and retrieve the set of 3 values relating to them, something like this (which doesnt work):</p>
  
  <pre><code>foreach( $orderItems as $obj=&gt;$quantity=&gt;$total)
  {
      echo $obj;
      echo $quantity;
      echo $total;
  }
  </code></pre>
  
  <p>Would someone be able to give some advice on how I would accomplish this, or even a better way for me to be going about this task. Any information relating to this, including links to tutorials that may cover this, would be greatly appreciated. Thanks!!</p>