How to loop my data for PHP
<p>I have some data which was json decoded and looks like this:</p>

<pre><code>stdClass Object
(
    [6] =&gt; stdClass Object
        (
            [13] =&gt; stdClass Object
                (
                    [buildingId] =&gt; 1
                )

        )

    [8] =&gt; stdClass Object
        (
            [20] =&gt; stdClass Object
                (
                    [Id] =&gt; 1
                )

        )
</code></pre>

<p>Thing is i don't know how to loop to get the information to use it in my script.</p>

<p>I need to get for example:</p>

<pre><code>$key, $innerkey, $Id = 1
Object [8][20].Id = 1
</code></pre>

<p>The two numbers are X;Y co ordinates so its important i get those values aswell as the id.</p>

<p>I managed to get the first key:</p>

<pre><code>$obj = JSON_decode($_GET['data']);  
    foreach($obj as $key) { 
        echo $key;                      
    }
</code></pre>

<p>How do i get the innerkey assigned to a variable ?</p>
