I use this code for PHP to get Stack Overflow reputation.
$feed = json_decode(file_get_contents("http://api.stackexchange.com/2.1/users/22656?order=desc&sort=reputation&site=stackoverflow&filter=!*MxOyD8qN0Yghnep", true), true);
$array = $feed['items'][0];
$rep = $array['reputation'];
echo $rep;
But I get null
for feed. Also user account is Jon Skeet which is where I get the ID 22656. How can I fix this?
The problem is that the response is also gzipped.
My preferred fix would be to use curl, with CURLOPT_ENCODING option.
Though, you can use normal FGC, then inflate the response back into uncompressed.