title: Error in getting data from Json in PHP
body: <p>I am trying to access data from <code>json</code> in <code>PHP</code> but it seems not working.</p>
  
  <p>code: </p>
  
  <pre><code>$raw =file_get_contents("http://api.mydomain.com/data.json");
  $data = json_decode($raw-&gt;list);
  echo $data;
  </code></pre>
  
  <p>I'm getting error that list is not an object.</p>
  
  <p>Here is my <code>json</code></p>
  
  <pre><code>{ "list" : [ { "data1":" my data"}, {"data2": "my data 2"}]};
  </code></pre>
  
  <p>What did u do wrong? Also how can i access <code>data1</code> and others?</p>