Skip to content

Instantly share code, notes, and snippets.

@lin
Created October 17, 2014 18:48
Show Gist options
  • Save lin/fabf2c96319ea3227906 to your computer and use it in GitHub Desktop.
Save lin/fabf2c96319ea3227906 to your computer and use it in GitHub Desktop.
php decode json to array from url
<?php
$string = file_get_contents("https://www.googleapis.com/customsearch/v1?key=AIzaSyC2seiP3CUr3NK77OzvtzsXO_Q9RyVqogk&cx=011630460259922505622:k84o2c59sea&num=1&alt=json&q=Alice%20and%20Olivia%20brand%20logo&searchType=image");
$json = json_decode($string, true);
echo $json['items'][0]['image']['thumbnailLink'];
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment