- file_get_contents: documentation ( source)
- json_decode: documentation ( source)
- preg_replace: documentation ( source)
<?php
$file=file_get_contents("http://9gag.com/");
$jsonp_string = preg_replace("/[^(]*\((.*)\)/", "$1", $file);
$json = json_decode($jsonp_string, true);
echo $json['count'];