I am using a RSS-feed to display some news. But the thing is that i use bootstrap and the RSS-feed send a image that i cant figure out how to access, so i can putt class="img-responsive"
on it. Now the images dosent fits to the screen..
php code when i collect the elments from the RSS-feed:
<?php
$q=$_GET["q"];
$xml=("https://www.gamereactor.se/rss/rss.php?texttype=4");
$xmlDoc = new DOMDocument();
$xmlDoc->load($xml);
$channel=$xmlDoc->getElementsByTagName('channel')->item(0);
$channel_title = $channel->getElementsByTagName('title')->item(0)->childNodes->item(0)->nodeValue;
$channel_desc = $channel->getElementsByTagName('description')->item(0)->childNodes->item(0)->nodeValue;
$channel_desc = $channel->getElementsByTagName('title')->item(0)->childNodes->item(0)->nodeValue;
echo("<br>");
echo($channel_desc."</p>");
$x=$xmlDoc->getElementsByTagName('item');
for ($i=0; $i<=2; $i++) {$item_title=$x->item($i)->getElementsByTagName('title')->item(0)->childNodes->item(0)->nodeValue;
$item_link=$x->item($i)->getElementsByTagName('link')->item(0)->childNodes->item(0)->nodeValue;
$item_desc=$x->item($i)->getElementsByTagName('description')->item(0)->childNodes->item(0)->nodeValue;
echo ("<p><a href='".$item_link."'>".$item_title."</a>");
echo ("<br>");
echo ($item_desc);
echo ("<img class=img-responsive>".$item_desc."<img></p>");} //where im trying to access the image..
?>
This how the xml from the RSS-feed looks:
<title>Nya Need for Speed kommer att kräva internetuppkoppling</title>
<description><img src="http://www.gamereactor.dk/media/55/_1455534.jpg"><p>Svenska Ghost Games pillar för fullt med kommande Need for Speed som ska släppas till PC, Playstation 4 och Xbox One den 3:e november. Förutom att vi tidigare rapporterat...</p></description>