I have a php code like this which mainly fetch rss feed from a site
<?php
$xmlstr = file_get_contents("http://news.myweb.com.au/index.php?format=feed&type=rss");
$xml_object = new SimpleXMLElement($xmlstr);
$items = $xml_object->channel->item;
?>
<?php foreach($items as $item):?>
<h1> <?php echo $item->title;?> </h1>
<p >
<?php echo substr($item->description, 0, 250);?>...
<a href="<?php echo $item->link;?>">Read More</a>
</p>
<?php endforeach; ?>
now I am including that file in some other file like this
<div class="leftColumnH">
<?php include('blog.php');?>
</div>
<div class="rightColumnH">
<h2 class="fontstyle leftColumnText ">Web Development & Graphic Design</h2>
some test here
</div>
But while I see it in browser, “rightcolumn” goes inside a div with class “feed-description” inside leftColunm.
You have to make sure that your
<?php echo substr($item->description, 0, 250);?>is not echoeing any div tag. If$item->descriptionhas<div>tag, then your truncate might be removing the</div>tag.If its echoing div tag then close the tag.
Hope this helps.