Last active
March 19, 2024 18:36
-
-
Save bossman759/4479596 to your computer and use it in GitHub Desktop.
Parse RSS(XML) in php!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$html = ""; | |
// URL containing rss feed | |
$url = "http://www.realbeta.net63.net/blog/rss?id=1"; | |
$xml = simplexml_load_file($url); | |
for($i = 0; $i < 1; $i++){ | |
$title = $xml->channel->item[$i]->title; | |
$link = $xml->channel->item[$i]->link; | |
$description = $xml->channel->item[$i]->description; | |
$pubDate = $xml->channel->item[$i]->pubDate; | |
$html .= "<a target='_blank' href='$link'><b>$title</b></a>"; // Title of post | |
$html .= "$description"; // Description | |
$html .= "<br />$pubDate<br /><br />"; // Date Published | |
} | |
echo "$html<br />"; |
tnx
it's just display the information ? we don't like a tool that do it in php ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks