title: Notice: Trying to get property of non-object - maybe string?
body: <p>I would like to get the value of "Records"</p>
  
  <p>When is try this code:</p>
  
  <pre><code>$json = file_get_contents('URL');
  var_dump($json);
  </code></pre>
  
  <p>This is the result:</p>
  
  <pre><code>string(25289) "ï»¿{ "ProductsSummary": { "Records": 10, "TotalRecords": 2874, "TotalPages": 288, "CurrentPage": 1 }, "Products": [ { "...
  </code></pre>
  
  <p>When I try this code</p>
  
  <pre><code>$json = file_get_contents('URL');
  $obj = json_decode($json);
  
  echo $obj;
  echo $obj-&gt;{'ProductsSummary'}-&gt;{'Records'};
  echo $obj-&gt;ProductsSummary-&gt;Records;
  echo $obj[0]-&gt;ProductsSummary-&gt;Records;
  echo $obj-&gt;ProductsSummary[0]-&gt;Records;
  echo $obj-&gt;ProductsSummary[1];
  </code></pre>
  
  <p>The Output is:</p>
  
  <pre><code>{ "ProductsSummary": { "Records": 10, "TotalRecords": 2879, "TotalPages": 288, "CurrentPage": 1 }, "Products": [ { "Last.... }
  
  Notice: Trying to get property of non-object in  ...
  Notice: Trying to get property of non-object in  ...
  Notice: Trying to get property of non-object in  ...
  </code></pre>