title: How to foreach multidimensional array with key value
body: <p>I have a multidimensional array with key value. I want to loop the data in that array but I don't know how.</p>
  
  <p>This is my array:  </p>
  
  <pre><code>$myArray=     Array
      (
          '134' =&gt; Array
              (
                  '1138' =&gt; Array
                      (
                          'id' =&gt; 1138,
                          'qty' =&gt; 1,
                          'price' =&gt; 4900000,
                          'name' =&gt; 'Pioneer AVH X5850BT Head Unit Double Din 7Inch',
                          'options' =&gt; Array
                              (
                                  'image' =&gt; '865e6ad631fa45d408acfc6f8a8ff008.jpg',
                                  'created_by' =&gt; 134
                              ),
  
                          'rowid' =&gt; 'f9e62f7ce9665a25ff40848744dd83f4',
                          'subtotal' =&gt; 4900000
                      ),
  
                  '1003' =&gt; Array
                      (
                          'id' =&gt; 1003,
                          'qty' =&gt; 1,
                          'price' =&gt; 2250000,
                          'name' =&gt; 'Steelmate SW813 Subwoofer Aktif 10 Inch',
                          'options' =&gt; Array
                              (
                                  'image' =&gt; '962df806d5adc7bd0d22666fe996f139.jpg',
                                  'created_by' =&gt; 134
                              ),
  
                          'rowid' =&gt; '7aa455ef597b2906e3895783bd7a5c70',
                          'subtotal' =&gt; 2250000
                      )
  
              ),
  
          '157' =&gt; Array
              (
                  '2527' =&gt; Array
                      (
                          'id' =&gt; 2527,
                          'qty' =&gt; 1,
                          'price' =&gt; 2475000,
                          'name' =&gt; 'Rockford Fosgate P165SE Speaker Split 2way Komponen',
                          'options' =&gt; Array
                              (
                                  'image' =&gt; '81027273a2ad59a96aec85ec66ce2704.jpg',
                                  'created_by' =&gt; 157
                              ),
  
                          'rowid' =&gt; 'ed9301accd0d84bd0417609aa80cebc7',
                          'subtotal' =&gt; 2475000
                      )
  
              )
  
      );
  </code></pre>
  
  <p>How do I loop / foreach that array?</p>
  
  <p>I guess there is a foreach inside a foreach, but I don't know how to do that.</p>