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 ? Link to comment https://forums.phpfreaks.com/topic/110415-weird-special-characters-when-loading-xml/ 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 ??? Link to comment https://forums.phpfreaks.com/topic/110415-weird-special-characters-when-loading-xml/#findComment-566472 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? Link to comment https://forums.phpfreaks.com/topic/110415-weird-special-characters-when-loading-xml/#findComment-566584 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; ?> Link to comment https://forums.phpfreaks.com/topic/110415-weird-special-characters-when-loading-xml/#findComment-566595 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.