I have parsed some RSS feeds into a database. Yes I'm using carp evolution, no i cant just aggregate them. One of the feeds is formatted annoyingly wrong, so when I print out the description from the DB it has all this junk on it : Author: Craig Subject: Mirafone S-186 value? Posted: Wed Nov 02, 2005 5:58 pm (GMT -5) Topic Replies: 0 <span class="postbody">WHAT I WANT IS HERE</span> What I want is to show is the text between the SPAN tags. Are there any php functions i can apply to only get the contents of those span tags? I've looked at ereg_replace and preg_replace and strip tags and all sorts of php tricks, no dice. Thanks in advance for a hint! -R
if you are not up to regular expressions, this might be simpler. $start = strpos('<span class="postbody">', $thestring); $start = $start + 23; $end = strpos("</span>", $thestring); $thebitiwant = substr($thestring, $start, $end - $start);