PHP RSS / Blog Reader

 

If you would like your own RSS / Blog reader then here it is. It's simple to use and easy to install.

The background box size can be adjusted using the CSS code below.

 

Check it out!

 

Example

Wizzardweb.co.uk Latest

13-01-08 New script! JavaScript Change Text Colour OnMouseOver v.2
13-01-08 New Script! JavaScript Change Text OnMouseOver
23-11-07 New Script! JavaScript Required Field v.3
20-11-07 New Script! JavaScript Count Down
20-11-07 Would you like a customised script for your site?
14-11-07 New Script! JavaScript Change Image on Specified Date
18-09-07 New script! JavaScript Highlight Text Button

 

 

 

 

 

 

 

 

 

Script Source

<The PHP Script >


<?php
// +++++++++++++++++++++++++++++++++++
// + Script by www.wizzardweb.co.uk
// + Copyright 2016
// + Pleas DO NOT remove this information
// +++++++++++++++++++++++++++++++++++

function RSSreader($url)
{
$rssstring = file_get_contents($url);
preg_match_all("#<title>(.*?)</title>#s",$rssstring,$titel);

preg_match_all("#<item>(.*?)</item>#s",$rssstring,$items);
$n=count($items[0]);

for($i=0;$i<$n;$i++)
{
$rsstemp= $items[0][$i];
preg_match_all("#<title>(.*?)</title>#s",$rsstemp,$titles);
$title[$i]= $titles[1][0];
preg_match_all("#<pubDate>(.*?)</pubDate>#s",$rsstemp,$dates);
$date[$i]= $dates[1][0];
preg_match_all("#<link>(.*?)</link>#s",$rsstemp,$links);
$link[$i]= $links[1][0];
}

echo "<h2>".$titel[1][0]."</h2>";
for($i=0;$i<$n;$i++)
{
$timestamp=strtotime($date[$i]);
$datum=date('d-m-y', $timestamp);
if(!empty($title[$i])) echo $datum."\t\t\t <a href=".$link[$i]." target=\"_blank\">".$title[$i]."</a><br>";
}
}
?>
<span class="box">

// Place the following PHP script were you would like your rss / blog

<?php
$rss='https://www.wizzardweb.co.uk/rss/wizzardweb_rss.xml';
RSSreader($rss);
?>

</span>

 

<The CSS >

<style type="text/css">
<!--
.box {
background-color: #ffffff;
position: absolute;
font-family: "Arial", Tahoma;
color: #000000;clear:both;float:left;padding:8px;border:1px solid black;font-size:.8em;background-color:#F8F8F8;
}
-->
</style>

 

 

Please let me know if this script was helpful to you.

[rating]