PHP - Parse Json : <p>I have an answer in json, but how can I parse?</p>

<p>Response: (var_dump)</p>

<pre><code>C:\wamp64\www\PHP\index.php:17:
object(stdClass)[1]
  public 'success' =&gt; boolean true
  public 'data' =&gt; 
    array (size=1)
      0 =&gt; 
        object(stdClass)[2]
          public 'key' =&gt; string '11111-11111-11111-11111-11111' (length=29)
          public 'allowed_acts' =&gt; int 1
</code></pre>

<p>I tried this code, but dont works</p>

<pre><code>if ($keys) {

$json = json_decode($keys);

//$dump = var_dump($json);

//echo $dump;

echo $json['key'];
}
</code></pre>

<p>Fatal error: Cannot use object of type stdClass as array in C:\wamp64\www\PHP\index.php on line 21</p>
