Retrive XML/HTML from a page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
KossanMuu
Forum Newbie
Posts: 1
Joined: Mon Jun 16, 2008 5:41 am

Retrive XML/HTML from a page

Post 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..
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: Retrive XML/HTML from a page

Post by Kieran Huggins »

The file in question uses the UTF-8 charset - take a look at the mb_string functions
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Re: Retrive XML/HTML from a page

Post by Ambush Commander »

Actually, all he probably has to do is header('Content-type: text/html;charset=UTF-8')
Post Reply