Skip to content

Instantly share code, notes, and snippets.

@bossman759
Last active March 19, 2024 18:36
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save bossman759/4479596 to your computer and use it in GitHub Desktop.
Save bossman759/4479596 to your computer and use it in GitHub Desktop.
Parse RSS(XML) in php!
$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 />";
@iambasilk
Copy link

Thanks

@kubilaysevuk
Copy link

tnx

@dorian-404
Copy link

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