-
-
Save Ilgrim/9a68635b190654e5d109c243942dc812 to your computer and use it in GitHub Desktop.
Parse RSS(XML) in php!
This file contains 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 />"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment