PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
voltrader
Forum Contributor
Posts: 223 Joined: Wed Jul 07, 2004 12:44 pm
Location: SF Bay Area
Post
by voltrader » Thu Mar 15, 2007 8:54 pm
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?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Mar 15, 2007 11:05 pm
Well, there's "2 ×
strpos() +
substr() " or
regex .
voltrader
Forum Contributor
Posts: 223 Joined: Wed Jul 07, 2004 12:44 pm
Location: SF Bay Area
Post
by voltrader » Sun Mar 18, 2007 8:42 pm
Thanks feyd.
I think it'll be strgpos() and substr() then
Regex is the dark arts.