hi there:
i have somethig like this in my buff: <TD>Average Rate</TD><TD align="right">31.09</TD>
i want to apply preg_match to get the value 31.09 out..how do it do it?>
please help!
-smita
preg_match('@<TD>Average Rate</TD><TDalign="right">(.*?)</TD>@',$contents,$match);
Hope that helps
Assuming the html tag usage is consistent:
if(preg_match('#(?:<TD align="right">)\d+(\.\d+)?(?:</TD>)#i', $string, $matches)) { $value = $matches[0]; } else { $value = NULL; // or whatever you want to do if not found }