ainoy31 Posted February 11, 2008 Share Posted February 11, 2008 Hello- I am trying to extract the Status value out of the following html tag. In this case, the status is OUT FOR DELIVERY but it could be something else later on. <tr><td><STRONG>Status:</STRONG></td> <td align="left">OUT FOR DELIVERY</td></tr> Here is my code that I have tried but it is only etxracting the word 'OUT' out. if(stristr($line, 'Status:')) { preg_match_all('%(?<=<td align="left">)([a-zA-Z]+)%', $data, $matches, PREG_SET_ORDER); predump($matches); $status = $matches[0][2]; } Much appreciation. Quote Link to comment Share on other sites More sharing options...
ainoy31 Posted February 11, 2008 Author Share Posted February 11, 2008 I figured it out. Solution: preg_match_all('%(?<=<td align="left">)[a-zA-Z\s]+%', $data, $matches, PREG_SET_ORDER); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.