E
E
EvGenius Karlonius2017-02-02 01:59:02
PHP
EvGenius Karlonius, 2017-02-02 01:59:02

How to get data from php array?

echo $token['access_token'] ; gives an error ( Notice: Undefined index: access_token ). Tell me how to get access to access_token correctly ?
Content print_r($token);

Array ([{ "access_token": "EAAFONltZB2jwBAOZCbrSbat1EFZCdwxQuZC4XFJXJtcIPD0qAZARfJLIQ
HJvqUv0LItHFiyBU7LZA8OLHdc9ZAWkDkSDvHiFF9thtl7NeZBnLGVdXOhw0XhxGy3RduC
4ZABjYuxbue1HBHFK5CoaKdEzYspghkN93KqpvSBFHNtZAgJAZDZD", "token_type": "bearer",
"expires_in": 5135190}] =>)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2017-02-02
@BloodKarl

the array contains json, which must first be decoded.
php.net/manual/en/function.json-decode.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question