AJAX PHP Parse URL and Content of file -


i have following file: https://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=mandarin

the following code: http://plnkr.co/edit/xiuoazuiipqgn4depxhi
gets images file , works great.

when turn search web (https://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=mandarin) want url , content "tags" code that's provided. can with code?

try this:

<?php $json=file_get_contents("http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=mandarin"); $json=json_decode($json,true);  $data=array();  foreach ($json['responsedata']['results'] $results) {     $data[]=array("url"=>$results['url'],"content"=>$results['content']); }  print_r($data); ?> 

Comments