Trying to get info out of an object within and object PHP
<p>Ok, I'm very new to PHP. I will try my best to explain my question. </p>

<p>This is a var_dump of a json object. <br/>
What i am trying to do is access the information in the 'register_sale_products' object.<br/>It contains product info like SKU, Price etc of the products in each sale. In the example below i am trying to list the SKU's.  </p>

<pre><code>object(stdClass)[1]
  public 'register_sales' =&gt; 
    array
      0 =&gt; 
        object(stdClass)[2]
          public 'id' =&gt; string '7c969b77-6825-bc65-3e04-64f922a570eb' (length=36)
          public 'register_id' =&gt; string '07709f8e-8d90-11e0-8e09-4040f540b50a' (length=36)
          public 'invoice_number' =&gt; string 'BH8464' (length=6)
          public 'register_sale_products' =&gt; 
            array
              ...
          public 'totals' =&gt; 
            object(stdClass)[6]
              ...
          public 'register_sale_payments' =&gt; 
            array
              ...
      1 =&gt; 
        object(stdClass)[9].......
</code></pre>

<p>I managed to get one SKU from the first "Product" object array 'register_sale_products' using this code. <br/></p>

<pre><code>$array = array()    ;
foreach($data-&gt;register_sales as $sale){
    $array =    $sale-&gt;register_sale_products ;
    }
foreach($array as $saleprod){
        $details = explode(' / ', $saleprod-&gt;sku);
    $result = $details[0];
    }
echo $result;
</code></pre>

<p>I really need to get an a result of each object in the array. <br/>
Any help much appreciated. </p>
