the content you see is gzipped
you might be interested looking at gzdecode
or zlib-decode
(Please note that Zlib support in PHP is not enabled by default)
Your code might look like this
$url = 'http://www.desi-tashan.com/category/pakistan-tvs/aaj-tv/3-idiots/';
$content = file_get_contents($url);
$decoded_content = gzdecode($content); // or zlib_decode($content);
Another solution here on stackoverflow, which adds HTTP header Accept-Encoding
in the request telling the server NOT to gzip.
However, it doesn't work on www.desi-tashan.com
, the server is ignoring Accept-Encoding
header, and always return gzipped content
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…