Page 1 of 1

Retrive XML/HTML from a page

Posted: Mon Jun 16, 2008 5:46 am
by KossanMuu
Hello

Im trying to write a PHP code that will download the XML from this page.

http://torrents.thepiratebay.org/filelist/4240969

When i load that page in PHP , i get some very weird signs/characters.
I first suspect that i needed JSON to convert the signs.. but i couldnt get my code to work..


This is a small sample of my simple code:

Code: Select all

$file_open =file('http://torrents.thepiratebay.org/filelist/4240969');
foreach($file_open as $row){
echo  $row;
}
Now... How can i convert those letters into "real letters"..
big thx in advance..

Re: Retrive XML/HTML from a page

Posted: Mon Jun 16, 2008 5:59 am
by Kieran Huggins
The file in question uses the UTF-8 charset - take a look at the mb_string functions

Re: Retrive XML/HTML from a page

Posted: Mon Jun 16, 2008 8:19 am
by Ambush Commander
Actually, all he probably has to do is header('Content-type: text/html;charset=UTF-8')