Json
{
"articles": [
{
"id": 1,
"name": "Josh"
},
{
"id": 2,
"name": "Jenny"
},
{
"id": 3,
"name": "Chris"
}
]
}
How do i search names by id?
What should I do if i want select only Josh?
Now I'm decoding json with php and foreach loop.
$url = "articles.json";
$json = json_decode(file_get_contents($url));
foreach($json->articles as $articles){
echo $articles->name;
}
I want select only that name where id is 1.