title: stdClass Object and array how to using php
body: <p>I'm trying to get the twelve ids that this structure shows: </p>
  
  <pre><code>stdClass Object
  (
      [checkins] =&gt; stdClass Object
          (
              [count] =&gt; 12
              [items] =&gt; Array
                  (
                      [0] =&gt; stdClass Object
                          (
  
                              [venue] =&gt; stdClass Object
                                  (
                                      [id] =&gt; 4564654646456
                                      .
                                      .
  </code></pre>
  
  <p>I do: </p>
  
  <pre><code>$checkins = $fsObjUnAuth-&gt;get("/users/self/checkins");
  $count = $checkins -&gt;response-&gt;checkins-&gt;count;  // so I can  get 12
  
   for( $i = 0; $i &lt; $count; $i ++)
    {
        $a1[] = $checkins['items'][$i]['venue']['id'];  //two tries
        $a2[] = $checkins -&gt;response-&gt;checkins-&gt;items-&gt;$i-&gt;venue-&gt;id;
          echo $i; echo ": ";
          echo $a1;echo"&lt;br&gt;";
          echo $a2;echo"&lt;br&gt;"
    } 
  </code></pre>
  
  <p>But I get:
  Fatal error: Cannot use object of type stdClass as array in  line.. </p>
  
  <p>Please can someone show me how to do this? </p>
  
  <p>Thanks a lot</p>