title: How to parse this multi dimensional array
body: <p>I have tried everything I know and I have failed totally to parse this multi dimensional array so that I can get the keys and values out of both the inner and outer array for saving to a DB. </p>
  
  <pre><code>array:10 [▼
    "_token" =&gt; "aHgDik0zuDxxBqYgbi0ZTkaPyG3CVwk5WO7LtU6u"
    "contractor_invoice_no" =&gt; ""
    "date" =&gt; "26-11-2015"
    "contractor_reference" =&gt; "sdfsdf"
    "workorder_reference" =&gt; "151 alandale"
    "square_installed" =&gt; "455"
    "square_invoice" =&gt; "677"
    "other_work_" =&gt; array:3 [▶]
    "other_invoice_" =&gt; array:3 [▶]
    "comments" =&gt; "comments"
  ]
  </code></pre>
  
  <p>I have tried nested foreach loops and I always get an array to string conversion error when echoing out the values of the outer array. I will not show you every single attempt I have made, but this attempt below gives me all the outer array but then shows an error on the echo statement, which tells me it is failing when it hits the inner array. </p>
  
  <pre><code>foreach($invoice as $key=&gt; $value)
  {
      echo " Data $value  Key $key";   // Array to String conversion error here ! 
  
      if (is_array($value) || is_object($value))
      {
          foreach ($value as $sample=&gt;$data)
          {
              echo "Key $sample Data $data";
          }
      }
  }
  </code></pre>
  
  <p>How do I make this work ? </p>
  
  <p>MANY THANKS !</p>