Regular Explression
| From: | Holev` | Date: | Mon, 06 Nov 2000 22:29:38 +0000 |
| Subject: | Regular Explression | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-23993@lists.php.net to get a copy of this message | ||
Hey,
I have something like this in a file:
<table width=100% cellspacing=0 cellpadding=0 border=0>
<tr><td width=2% rowspan=2> </td>
<td width=6% valign=top class=MonthViewDateNumber
rowspan=2>5 </td>
<td width=90% valign=top class=MonthViewDayOfWeek>Sunday </td>
<td width=2% rowspan=2> </td></tr>
<tr><td width=90%>
</td></tr>
</table>
and I made this file to get the information from it:
<?
if($file = fopen("d:/cal.html", "r")) {
while(!feof($file)) {
$from = fgets($file, 1024);
ereg("
<table width=100% cellspacing=0 cellpadding=0 border=0>
<tr><td width=2% rowspan=2> </td>
<td width=6% valign=top class=MonthViewDateNumber
rowspan=2>(.*) </td>
<td width=90% valign=top class=MonthViewDayOfWeek>(.*) </td>
<td width=2% rowspan=2>(.*)</td></tr>
<tr><td width=90%>
(.*)
</td></tr>
</table>
",$from,$to);
echo $to[0];
}
}
?>
what am I doing worng?
should I put \n instead of actual new lines?
thanx.
--
_______________________________________________
David Berlin
webmaster@builder.co.il