how to assign values from vardump output to variables in php? : <p>here i have json output as below.what i want do is i want to take scope,production,refreshtoken,access_token as separate php variables from var_dump output.</p>

<p>here is the json output</p>

<pre><code>array ( 'status' =&gt; 'OK', 'statusCode' =&gt; 200, 'time' =&gt; 1.628268, 'header' =&gt; array ( 0 =&gt; 'HTTP/1.1 200 OK Date: Fri, 06 May 2016 06:22:42 GMT Server: O2-PassThrough-HTTP Content-Type: application/json Pragma: no-cache Cache-Control: no-store Transfer-Encoding: chunked ', ), 'body' =&gt; '{"scope":"TARGET","token_type":"bearer","expires_in":2324,"refresh_token":"4567f358c7b203fa6316432ab6ba814","access_token":"55667dabbf188334908b7c1cb7116d26"}', )
</code></pre>

<p>Here is my php</p>

<pre><code>var_dump($r);

echo $var[0]."&lt;br&gt;";
echo $var[1]."&lt;br&gt;";
echo $var[2]."&lt;br&gt;";
echo $var[3]."&lt;br&gt;";
echo $var[4]."&lt;br&gt;";
echo $var[5]."&lt;br&gt;";
echo $var[6]."&lt;br&gt;";
echo $var[7]."&lt;br&gt;";
echo $var[8]."&lt;br&gt;";
</code></pre>
