Skip to content

Instantly share code, notes, and snippets.

@umutakturk
Created September 29, 2012 19:10
Show Gist options
  • Save umutakturk/3804958 to your computer and use it in GitHub Desktop.
Save umutakturk/3804958 to your computer and use it in GitHub Desktop.
JSONP Decode
<?php
$jsonp_string = preg_replace("/[^(]*\((.*)\)/", "$1", file_get_contents("http://api.pinterest.com/v1/urls/count.json?callback=receiveCount&url=http://9gag.com/"));
$json = json_decode($jsonp_string, true);
echo $json['count'];
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment