Hello,
I’m parseing XML/RSS onto my page using php. Working fine so far, but i need help with one part.
the link in the RSS to the article is
[url]http://www.medicalnewstoday.com/articles/133241.php
But what i would like to do is instead of pulling out that link, i would like to pull out the printer friendly link which is contained in the article, so for this page i would like to display
[url]http://www.medicalnewstoday.com/printerfriendlynews.php?newsid=133241
How would i go about modifying my code for this ?
[code=php]
$rss_document = simpleXML_load_file(‘http://www.medicalnewstoday.com/rss/allergy.xml’);
/Loop through each item in document
foreach($RSS_doc->channel->item as $RSS_item) {
//The variable $RSS_item will hold a different item for each loop
//Write the current item’s title to the screen in HTML tags
echo “<h3>$RSS_item->title</h3>”;
echo “<a href='”.$RSS_item->link.”‘>{$RSS_item->link}</a><br />”;
echo “<b>$RSS_item->pubDate</b><br />”;
echo “$RSS_item->description<br /><br />”;