title: How do I access this array
body: <p>Hi I have an array result which is generated by following code:</p>
  
  <pre><code>//Get House Sales Date
  // Create a stream
  $username = "test";
  $password = "test";
  $remote_url2 = "https://www.streetcheck.co.uk/api/v1/postcode/".$cleanpostcode."/saleprices";
  $opts2 = array(  'http'=&gt;array(    'method'=&gt;"GET", 'header' =&gt; "Authorization: Basic " . base64_encode("$username:$password")));
  $context2 = stream_context_create($opts2);
  
  //Open the file using the HTTP headers set above
  $json2 = json_decode(file_get_contents($remote_url2, false, $context2));
  
  //If Valid Results Returned
  if($json2-&gt;message="ok")
  {
      print_r($json2);
  </code></pre>
  
  <p>The results of the query can be seen <a href="http://prntscr.com/59okbm" rel="nofollow">here</a>.</p>
  
  <p>What I need to be able to do is for each result, to insert values to another table, so far I am looking at something like this:</p>
  
  <pre><code>foreach ($json2-&gt;result-&gt;sales as $item1)
  {
      $pricepaid = $json2-&gt;result-&gt;sales-&gt;pricePaidGBP;
      $propertytype = $json2-&gt;result-&gt;sales-&gt;propertyType;
      $holding = $json2-&gt;result-&gt;sales-&gt;holding;
      $nameornumber = $json2-&gt;result-&gt;sales-&gt;nameOrNumber;
      $fulllocation = $json2-&gt;result-&gt;sales-&gt;fullLocation;
      $dateoftransfer = $json2-&gt;result-&gt;sales-&gt;dateOfTransfer;
  </code></pre>
  
  <p>But the results are coming back as null, what am I doing wrong please></p>