- file_get_contents: documentation ( source)
- json_decode: documentation ( source)
- preg_replace: documentation ( source)
<?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'];