I have json data like this:
{"result":{"total":19,"hits":[{"keyword":"sidney webb"},{"keyword":"dr webb"}]},"status_msg":"OK","status_code":200,"left_lines":1196851}
I need to extract from json only keywords. I try without success with code:
$json = '{"result":{"total":19,"hits":[{"keyword":"sidney webb"},{"keyword":"dr webb"}]},"status_msg":"OK","status_code":200,"left_lines":1196851}';
foreach ($json['result'] as $keywords)
{
echo $keywords['result']['keyword'];
}