Jump to content

man-chop

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Everything posted by man-chop

  1. <?php // rss page - $feed_url = "http://blog.kyleramirez.com/feed/"; // Load XML. $xml = simplexml_load_file($feed_url); // How many items to display from the RSS Feed ... $count = 3; // Grabbing the NameSpace URI for "itms" and "content" ... foreach ($xml->channel->item as $item) { $ns_content = $item->children('http://purl.org/rss/1.0/modules/content/'); if($count > 0){ echo " <ul class=\"pageitem\"> <li class=\"textbox\"><span class=\"header\">{$item->title}</span> {$ns_content->encoded} </li> <li class=\"menu\"> <span class=\"name\"><a href='{$item->link}'>View</a></span></li></ul> "; }else{ Return; } $count--; } ?> Above is a snippet of code used to extract the content:encoded and title from my RSS feed. I am looking for a way to strip the content part of a few tags, namely style and size and width tags so that I can fit it into the mobile section of my website. The mobile site is m.kyleramirez.com. You will be able to see how the rss feed is implemented there. This shouldn't be that complicated. I was trying to the str_replace to do it but I'm not sure how to put it in there. Any ideas? {$ns_content->encoded} is where the entire post is showing up. How do I add a str_replace to that?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.