J
J
jistulamle2017-09-06 14:35:29
PHP
jistulamle, 2017-09-06 14:35:29

How to pull the required information from an array of the following type in PHP?

I send a GET request with direct authorization to the vk.com website via (cURL - PHP) in response I receive the following information

{"access_token":"ghghj345ghg43hghg53h4f4d34d53fgd434kj53i6hk3","expires_in":0,"user_id":2121212}

how to pull ghghj345ghg43hghg53h4f4d34d53fgd434kj53i6hk3 from array or is it not an array?
Are there any options besides preg_match?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Dart, 2017-09-06
@jistulamle

$var = json_decode($data);
$need = $var['access_token']; // так в $need окажется ключ

J
jistulamle, 2017-09-06
@jistulamle

gobananas Dmitry @gobananas
Thank you
Seryozha Achen Seryozha Achen
I'm sorry I'm not attentive

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question