The following situation:
$text = "This is some <span class='classname'>example</span> text i'm writing to
demonstrate the <span class='classname otherclass'>problem</span> of this.<br />";
preg_match_all("|<[^>/]*(classname)(.+)>(.*)</[^>]+>|U", $text, $matches, PREG_PATTERN_ORDER);
I need an array ($matches) where in one field is "<span class='classname'>example</span>
" and in another "example".
But what i get here is one field with "<span class='classname'>example</span>
" and one with "classname".
It also should contain the values for the other matches, of course.
how can i get the right values?