How can i store access token and refresh token in php variable?


Hi, I wrote the code and received this json response:


but access token is not getting stored on $myrs variable.

Here is the full code :



$agent= ‘Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)’;

$ch = curl_init();
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
curl_setopt($ch, CURLOPT_HTTPHEADER, [‘Content-Type: application/x-www-form-urlencoded’]);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_URL,$url);


$rest= (json_decode($result, true));

How can i store the access token in a variable ?

Thank you!


Anyone to solve this issue ?