我有json数据,需要从json数据中检索URL对象
{
"_type": "SearchResponse",
"queryContext": {
"originalQuery": "Buford city, planning commission, GWINNETT county, ga"
},
"webPages": {
"webSearchUrl": "https://www.bing.com/search?q=Buford+city%2c+planning+commission%2c+GWINNETT+county%2c+ga",
"totalEstimatedMatches": 296000,
"value": [
{
"id": "https://api.cognitive.microsoft.com/api/v7/#WebPages.0",
"name": "City of Buford - Planning and Zoning Department",
"url": "https://cityofbuford.com/PlanningZoning.aspx",
"about": [
{
"name": "Buford"
}
]
}
}
}
$response = $request->send();
// echo $response->getBody();
$JsonData= $response->getBody();
$data=json_decode($JsonData,true);
foreach($data as $chunk)
{
echo $data[1];
}
“ URL”:“ https://cityofbuford.com/PlanningZoning.aspx” 需要访问该对象