Get everything inside

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Get everything inside

Post by klevis miho »

How can I get everything inside:
50px;">GET_EVERYTHING_HERE</span>

I've used this pattern:
'#50px;">(.+)</span>#s'
but doesn't work.
mikecampbell
Forum Commoner
Posts: 38
Joined: Tue Oct 12, 2010 7:26 pm

Re: Get everything inside

Post by mikecampbell »

Works fine for me...

Code: Select all

preg_match('#50px;">(.+)</span>#s', '50px;">GET_EVERYTHING_HERE</span>', $matches);

print_r($matches);
Array
(
[0] => 50px;">GET_EVERYTHING_HERE</span>
[1] => GET_EVERYTHING_HERE
)
Post Reply