How to decode Json with Curl? : <p>I want to echo the word 'Active' from the json.</p>

<p>"status":"Active"</p>

<p>PHP/CURL:</p>

<pre><code>$ch = curl_init("http://ip:port/player_api.php?username=$username&amp;password=$password");
    $headers = array();
    $headers[] = "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:51.0) Gecko/20100101 Firefox/51.0";

    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:51.0) Gecko/20100101 Firefox/51.0');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HEADER, 1);
    $result = curl_exec($ch);
// Now i need to decode the json
</code></pre>

<p>Json:</p>

<pre><code>{"user_info":{"username":"test","password":"test","message":"","auth":1,"status":"Active","exp_date":null,"is_trial":"0","active_cons":"0","created_at":"000","max_connections":"1","allowed_output_formats":["m3u8","ts","rtmp"]},"server_info":{"url":"111.111.111","port":"80","rtmp_port":"80","timezone":"test","time_now":"2018-03-20"}}
</code></pre>
