set_time_limit(0);
$ch = curl_init('http://www.tibia.com/community/?subtopic=highscores&world=Antica');
curl_setopt($ch, CURLOPT_RANGE, '0-999');
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
echo $data = curl_exec($ch);//get curl response
curl_close($ch);
And the example output is (it is slightly different every time I hit refresh button):
‹í]kSã8ºþNÕüOÍÕr™&™‚ ³ÜÒ3{æ¥8J¢Æ±2¾é=ûßÏ«‹Û±BãYÜåž,[¥÷òHz%[ÎÁØ›XÖÆàˆÐG=‹tz´O1ª S‡té[ZxF tm[Ô&è–YÝÀ%jÐ'¿½?¿<ütrÇË‹_X_BD1‡Ýîõç«^¤œàŠ(Èå%ÓwH¤$lšÌ·½°¨Ñý)s&W¼‰Ç¯Rb ¢‰Ð{dЪ zp×½=¿é¡ÞÿÞœ,úµ³vð·JU«0D@EÔ²ˆ³æ¯G'„A{Û0Ì1tjä´ÜØ4þŽšµZmóãÚзMÞÆQ4{íßà=:DSì@³ß ò2Ý-‹Ø#oŒ:¨± ‰þ-üË1}‡=¹Äéͦ¨ÝF%F‹ºßb²#i˜éO¢W> à]û\b ·<6]~ßÿÿ?k v¥&¨JuÖÖÞ®PB)¶èWm ƒÁþ~}¿ÖÜÛö÷wš ÒØ®Õ04IØÜ!õdS€1½ªuHö
The page is displayed correctly when I comment out CURLOPT_RANGE
EDIT: I added curl_setopt($ch, CURLOPT_ENCODING, "gzip"); The output seems to be okay, but only when the range starts with 0. If the range is for example 2000-3000, it outputs completely nothing.
EDIT 2: The error message is: "Error while processing content unencoding: invalid distance too far back"