A
A
Alexander Makarov2016-07-11 23:02:18
PHP
Alexander Makarov, 2016-07-11 23:02:18

Convert string to array?

Hello.
I can't convert the string to an array:
{"update_id":540804803, "message":{"message_id":139,"from":{"id":23645226,"first_name":"Ivan","last_name":" Ivanov"},"chat":{"id":2459226,"first_name":"Ivan","last_name":"Ivanov","type":"private"},"date":1468266128,"text": "Cncjcj"}}
Can you help?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
bears, 2016-07-11
@consme

This is json:

$str = '{"update_id":540804803, "message":{"message_id":139,"from":{"id":23645226,"first_name":"Ivan","last_name":"Ivanov"},"chat":{"id":2459226,"first_name":"Ivan","last_name":"Ivanov","type":"private"},"date":1468266128,"text":"Cncjcj"}}';

var_dump(json_decode($str, true));

A
Alexander Makarov, 2016-07-11
@consme

Ugh, here I am the brake. Thank you!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question