I have an RSS feed that i've integrated into my website using PHP.
I'm trying to figure out how I can format my php where I have html tags within using echo 'html code' or something similar so that I can style those html elements with CSS because php can't be styled by itself (at least from the research that i've done). I'm not sure what the best way is to integrate the html elements but most of my errors are coming from
$html .= ""
The RSS Feed currently looks like this
There are 3 things I want to do:
1. Take date and make it just Month, Day, and year. (get rid of day of week at the beginning and time & +0000 at the end so it's just Jun 13, 2016 for example)
2.Change the color of the titles (The news article's titles not "LMHS News".
- Add a link preferably an a href="" tag around each news article title.
Here is the source code
<div class="row">
<div class="col-md-6">
<div id="news-header">
<h2 id="lmhs-news">LMHS News</h2> <a href="http://508.63c.myftpupload.com/"><small class="more-news">More</small></a>
</div>
<div id="widgetmain">
<?php
$html = "";
$url = "http://508.63c.myftpupload.com/feed/";
$xml = simplexml_load_file($url);
for($i = 0; $i < 5; $i++) {
$date = $xml->channel->item[$i]->pubDate;
$title = $xml->channel->item[$i]->title;
$link = $xml->channel->item[$i]->guid;
$description = $xml->channel->item[$i]->description;
$html .= "<div>$date
<h3>$title</h3>
$description
</div>
";
}
echo $html;
?>
</div>
</div>