Brian Dunning wrote:
I have the source of a web page stored in $here and I want to set $this to whatever appears between '<span class="myclass">' and '</span>'. Example:

$here contains (amid tons of other stuff): <span class="myclass">This is a statement.</span>

I want to set $this to "This is a statement."

What code do you have so far?

if it's strictly between those tags, this should work:

preg_match_all('%<span class="myclass">(.*?)</span>%isU', $text, $matches);

$matches[1] will be an array with all matches.

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to