Forum Moderators: coopster
My question is this: No doubt this code can easily break, what is the most reliable (if you had to choose something) element to use as a condition for parsing out this string?
You know where this number appears in the HTML.
So are you looking for a function to extract it?
If the html looked like..
<span class="number">the number is 12345</span>
then the code I would use would look something like..
[pre]
$matches = array();
preg_match( '{<span\s*class\s*=\s*"number">the\s*number\s*is\s*([0-9]+)\s*</span>}i', $html, $matches);
if ( isset($matches[1]) )
echo "Number: ".$matches[1];
[/pre] hope that helps - if not then give us some more details.