if Posted June 16, 2008 Share Posted June 16, 2008 i tried this $string = file_get_contents('http://torrents.thepiratebay.org/filelist/4137201'); echo $string; and this is the result ‹������µÔMkƒ0ð{?EðÞú0ñ‘"£O–o:JΨ…lxö–²“gO×\I¢±I3gI3gI3WI3ó‡!•£7ÍÍÍÍŸwHÁ‚F7g˜s¦TJÙ³•l ƒ"~GÏmò ²¿Sû �� any ideas ? Quote Link to comment Share on other sites More sharing options...
if Posted June 16, 2008 Author Share Posted June 16, 2008 that should load an xml file but i get those weird characters ??? Quote Link to comment Share on other sites More sharing options...
DyslexicDog Posted June 16, 2008 Share Posted June 16, 2008 I get the same garbage, have you tried using cURL? Quote Link to comment Share on other sites More sharing options...
rhodesa Posted June 16, 2008 Share Posted June 16, 2008 It's returning the gzipped version. With cURL you can specify to not return the gzipped version: <?php $url = 'http://torrents.thepiratebay.org/filelist/4137201'; $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_ENCODING,'deflate'); $xml = curl_exec($ch); echo $xml; ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.