tags:

views:

15

answers:

1

Hi All,

I have a fetch function that injects rss content into a page for me. This returns an xml which contains the usual RSS elements like title, link, description but the problem is the returned description is a table with two tds which one contains an image the other the text. I am not sure how I can remove the table, img and the tds and be left only with the text using php and not javascript.

Any help is much appreciated.

<?php
require_once('rss_fetch.inc');

$url = 'http://www.domain.com/rss.aspx?typeid=0&amp;imagesize=120&amp;topcount=20';

if ( $url ) {
    $rss = fetch_rss( $url );
    //echo "Channel: " . $rss->channel['title'] . "<p>";
    echo "<ul>";
    foreach ($rss->items as $item) {
        $href = $item['link'];
        $title = $item['title'];
        $description = $item['description'];
        $pubdate = date('F dS, Y', strtotime($item['pubdate']));
        echo "<li><h3>$title<em>$pubdate</em></h3>$description <p><a href='$href' target='_blank'>ادامه مطلب</a></p><br/></li>";
    }
    echo "</ul>";
}

?>
+1  A: 

strip_tags() will do the job..

Powertieke
short and sweet. thanks
XGreen