M
M
magogo2019-03-23 08:41:46
PHP
magogo, 2019-03-23 08:41:46

How to output specific element from JSON in PHP?

{
"name" : "admin",
"id" : "34",
"id_to" : "8"
}

How to display the value of name?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anatoly, 2019-03-23
@magogo

$json_string='{"name":"admin","id":"34","id_to":"8"}';
$obj=json_decode($json_string);
echo $obj->name;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question