Display RSS(XML) in HTML format with PHP...

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
kevin7
Forum Commoner
Posts: 96
Joined: Fri May 21, 2004 6:54 am

Display RSS(XML) in HTML format with PHP...

Post by kevin7 »

how can i display the RSS of other people's website to my website, i mean display all the news... em... display from xml to html...

any script that doen that, or any idea to write that script?

thank you..
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

kevin7
Forum Commoner
Posts: 96
Joined: Fri May 21, 2004 6:54 am

Post by kevin7 »

wow... that was too complicated for me... any "already made" RSS parser that can be use directly? thank you
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

check hotscripts.com
yelvington
Forum Newbie
Posts: 1
Joined: Sat Aug 14, 2004 1:22 pm

Post by yelvington »

google php pear rss
to find the appropriate PEAR package.

Or upgrade to PHP5, where you can do this with just a few lines of code.

For an RSS 2.0 feed:

Code: Select all

<?php
$xml = simplexml_load_file('http://onlineathens.com/RSS/news.xml');
foreach($xml->channel->item as $item)
        echo "
        <li><a href="$item->link">$item->title</a> $item->pubDate</li>\r\n";
?>
Post Reply