I am aware that this has been asked and answered, and I am looking at previous solutions
How to get String value from json_decode in php, PHP - cant get value with json_decode and a couple of other questions.
I have a json object that is being returned from a cURL call,
$tokenInfo = GetToken();
echo $tokenInfo; // <-- this prints out the values as I would expect to see it (shown below)
$tokenJson = json_decode($tokenInfo); // <-- this does not seem to decode
echo 'Getting Token Info:';
echo $tokenJson['access_token']; // <-- this does not give me my access token
The resposne from my server to get my access token is as below
{"access_token":"xxxxxxxxxxxxxxxx","token_type":"bearer","expires_at":1626180544,"expires_in":86400,"refresh_token":"yyyyyyyyyyyyyy"}
I am trying to get the access token from this response, and anytime I try and get this value its coming back as false and I cant for the life of me figure out why.
I would appreciate any guidance you may have as I have not worked with PHP in a long time and thought that this should be pretty straight forward.