preg_match_all
| From: | Jay Fitzgerald | Date: | Tue, 27 May 2003 15:52:48 +0000 |
| Subject: | preg_match_all | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-149130@lists.php.net to get a copy of this message | ||
How do I create a preg_match for something like this?
<TD CLASS="time" ALIGN="CENTER" VALIGN="MIDDLE"><!-- insert time --> <B>7 PM</B></TD>
<TD BGCOLOR="#BFD8F6"><IMG SRC="spacer.gif" WIDTH="1" HEIGHT="1" BORDER="0" ALT=""></TD>I want to store the individual times in an array and then loop through them if that makes sense... I tried this but when i try to echo the results back out it doesnt work.... <? preg_match_all("|<TD CLASS=\"time\" ALIGN=\"CENTER\" VALIGN=\"MIDDLE\"><!-- insert time --> <B>(.*)</B></TD>\n
<TD BGCOLOR=\"#BFD8F6\"><IMG SRC=\"spacer.gif\" WIDTH=\"1\" HEIGHT=\"1\" BORDER=\"0\" ALT=\"\"></TD>\n|U",$read,$result);?> <? echo $result[1][0]; ?> Jay Fitzgerald, Design Director - CPW-A, CPWDS-A, CPWDV-A, CECM-A, CWCSB-A Bayou Internet - http://www.bayou.com Toll Free: 888.30.BAYOU (22968) Vox: 318.338.2034 / Fax: 318.338.2506 E-Mail: jayfitz@bayou.com ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf