Page 1 of 1

Method to extract certain data from a string

Posted: Thu Mar 15, 2007 8:54 pm
by voltrader
I'd like to pick up a sequence of numbers from a string of HTML.

The numbers always follow a certain sequence of HTML, say:

<unique html>hello</unique html>NUMBERS I WANT</td><more unique html>2nd GROUP OF NUMBERS I WANT</more unique html>

How can I then parse the string to extract the numbers I want, assuming that I can identify a bit of unique html before the numbers?

Posted: Thu Mar 15, 2007 11:05 pm
by feyd
Well, there's "2 × strpos() + substr()" or regex.

Posted: Sun Mar 18, 2007 8:42 pm
by voltrader
Thanks feyd.

I think it'll be strgpos() and substr() then :-D

Regex is the dark arts.