I have this JSON array data
{"accessToken":"eyJhbGciOiJSUzUxMiJ9.e","refreshToken":"QErx0bUxyx6wxFj5AXcAh21UuyO8ad/ULIaGlP3LU2lmXGnx0twbYdM+nJyfwAcK9Av50uZ3fSZ/2nhJwIi+bA==","expiresIn":"2021-11-11T10:20:33Z","issuedAt":"2021-11-11T10:05:33Z","tokenType":"Bearer"}
How do I get only accessToken
object from the array. i.e yJhbGciOiJSUzUxMiJ9.e
This is how I have tried
$response = curl_exec($curl);
curl_close($curl);
$token = $response['accessToken'];
echo $token;
But I get this error
Warning: Illegal string offset 'accessToken'