Aswad Shaik Aswad Shaik - 10 months ago 59
PHP Question

how to get single value from stdClass Object (access_token)

stdClass Object
[access_token] => EAAYX7VzZCIcABAGCnZADQJZBhXvaJ5eIJ34mNyIKLnFpbInEEZBJJJjjYunzsIBidrZARbZCUr68L66RVoiIgkcj9NW4Ssl1X7
[token_type] => bearer
[expires_in] => 5162059

I want to get output access_token ->

thanks in advance

Answer Source

You can do: $obj->access_token

Or you can turn it into an array:

$array = get_object_vars($obj);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download