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. Link to comment https://forums.phpfreaks.com/topic/90496-script/ 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); Link to comment https://forums.phpfreaks.com/topic/90496-script/#findComment-463995 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.