Forum Moderators: coopster
// pick out individual events & store them in an array
$matches = preg_match_all("<td[^>]*>(.*)</td>", $alltext, $arrdata);// raw output the TDs
print "<textarea>";
for ($i=0; $i<count($arrdata[0]); $i++) {
print "\nMatch $i:\n".$arrdata[0][$i];
}
print "</textarea>";
At this stage, I just want to grab all TDs and display them one by one. Eventually, I will parse the semi-structured data within the TD to make better sense of it.
Can someone please help?
<tr>
<td colspan=2 class=searchres>
<b><a href="[..url..]">[..event title..]</a></b><br>
Monday, 11/3/2003 at 4:00pm<br>
Meetings & Conventions<br>
[Event Category]
</td>
</tr>
I think I need to strip all that for the regexp to pick up what I'm requesting.
s (PCRE_DOTALL) modifier. If this modifier is set, a dot metacharacter in the pattern matches all characters, including newlines. Without it, newlines are excluded:
$matches = preg_match_all("/<td.*>(.*)<\/td>/Uis", $alltext, $arrdata);