K
K
KRHD2016-11-19 19:09:24
PHP
KRHD, 2016-11-19 19:09:24

How to get data from what seems to be a JSON response?

Here is the answer I get, how can I get error_code from there, let's say

string(271) "{"error":{"error_code":5,"error_msg":"User authorization failed: no access_token passed.","request_params":[{"key":"oauth","value":"1"},{"key":"method","value":"messages.addChatUser"},{"key":"chat_id","value":""},{"key":"user_id","value":""},{"key":"v","value":"5.37"}]}}"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2016-11-19
@KRHD

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