title: how do i get values from array/object
body: <p>I call the upload function and it returns a variable. when I do <code>var_dump($x)</code> it shows the following:</p>
  
  <pre><code>{"files":[{"name":"1004046_469695273124093_104592888_n_1_28860.jpg","size":0,"type":"image\/jpeg","error":"abort","delete_url":"http:\/\/www.xxx.com\/upload\/uploader\/server\/php\/?file=1004046_469695273124093_104592888_n_1_28860.jpg","delete_type":"DELETE"}]}array(1) {
  ["files"]=&gt;
      array(1) {
       [0]=&gt; object(stdClass)#24 (6) {
       ["name"]=&gt; string(47) "1004046_469695273124093_104592888_n_1_28860.jpg"
       ["size"]=&gt; int(0)
       ["type"]=&gt; string(10) "image/jpeg"
       ["error"]=&gt; string(5) "abort"
       ["delete_url"]=&gt; string(104) "http://www.xxx.com/upload/uploader/server/php/?file=1004046_469695273124093_104592888_n_1_28860.jpg"
       ["delete_type"]=&gt; string(6) "DELETE"
      }
   }
  }
  </code></pre>
  
  <p>I tried <code>var_dump(json_decode($x))</code> and the result is NULL. </p>
  
  <p>My question is how do I get the value name from this???</p>
  
  <p>tried these two: </p>
  
  <pre><code>echo $x-&gt;files[0]-&gt;name;
  echo " ********************** ";
  echo $x['files'][0]-&gt;name;
  echo " ********************** ";
  </code></pre>
  
  <p>and the result is </p>
  
  <pre><code>{"files":[{"name":"1004046_469695273124093_104592888_n_1_14299.jpg","size":78289,"type":"image\/jpeg","url":"http:\/\/www.xxx.com\/upload\/uploader\/server\/php\/files\/1004046_469695273124093_104592888_n_1_14299.jpg","thumbnail_url":"http:\/\/www.xxx.com\/upload\/uploader\/server\/php\/files\/thumbnail\/1004046_469695273124093_104592888_n_1_14299.jpg","delete_url":"http:\/\/www.xxx.com\/upload\/uploader\/server\/php\/?file=1004046_469695273124093_104592888_n_1_14299.jpg","delete_type":"DELETE"}]}{"files":[{"name":"1004046_469695273124093_104592888_n_1_12920.jpg","size":0,"type":"image\/jpeg","error":"abort","delete_url":"http:\/\/www.xxx.com\/upload\/uploader\/server\/php\/?file=1004046_469695273124093_104592888_n_1_12920.jpg","delete_type":"DELETE"}]}
  ********************** 
  {"files":[{"name":"1004046_469695273124093_104592888_n_1_15697.jpg","size":0,"type":"image\/jpeg","error":"abort","delete_url":"http:\/\/www.xxx.com\/upload\/uploader\/server\/php\/?file=1004046_469695273124093_104592888_n_1_15697.jpg","delete_type":"DELETE"}]}1004046_469695273124093_104592888_n_1_15697.jpg
  ********************** 
  </code></pre>