php - file_get_contents() returns garbled data -


i trying use api (eg: http://api.stackoverflow.com/1.0/users/3) data:

<?php  $data = file_get_contents('http://api.stackoverflow.com/1.0/users/3'); echo $data;  ?> 

but returned contents garbled. tested on couple different servers, including http://codepad.viper-7.com/9gfvsm. code or api?

the response gzipped. recommend use curl , set curlopt_encoding gzip.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -