Fetching an xml from an external url

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
Ratzzak
Forum Newbie
Posts: 21
Joined: Sat Jun 13, 2009 10:56 am

Fetching an xml from an external url

Post by Ratzzak »

How to fetch an xml from an external url using php???
jefffan24
Forum Commoner
Posts: 72
Joined: Mon Nov 02, 2009 8:18 am

Re: Fetching an xml from an external url

Post by jefffan24 »

have you tried:

<?php include('http://whatever.com/whatever.xml'); ?>
Ratzzak
Forum Newbie
Posts: 21
Joined: Sat Jun 13, 2009 10:56 am

Re: Fetching an xml from an external url

Post by Ratzzak »

Will that work??? I seriously doubt it
jefffan24
Forum Commoner
Posts: 72
Joined: Mon Nov 02, 2009 8:18 am

Re: Fetching an xml from an external url

Post by jefffan24 »

can't hurt to try?
Ratzzak
Forum Newbie
Posts: 21
Joined: Sat Jun 13, 2009 10:56 am

Re: Fetching an xml from an external url

Post by Ratzzak »

I tried and it didnt work :(
jefffan24
Forum Commoner
Posts: 72
Joined: Mon Nov 02, 2009 8:18 am

Re: Fetching an xml from an external url

Post by jefffan24 »

Yeah I didn't think it would just covering all the bases, sorry :/
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Fetching an xml from an external url

Post by VladSun »

http://php.net/manual/en/function.file-get-contents.php
Example #1
<?php
$homepage = file_get_contents('http://www.example.com/');
echo $homepage;
?>
There are 10 types of people in this world, those who understand binary and those who don't
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Fetching an xml from an external url

Post by VladSun »

There are 10 types of people in this world, those who understand binary and those who don't
Post Reply