i have the following problem: I try to find a part of a website using preg_match:
preg_match("|<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=5 WIDTH=1280 HEIGHT=50>
<TR VALIGN=TOP>
<TD WIDTH=1280 BGCOLOR=WHITE>
<FONT COLOR=BLACK SIZE=2>
This
is
a
test
</FONT>
</TR>
</TABLE>
|",$website,$matches);
It works fine... But the value of the table (in this case "This is a test") changes every day so i tried to do it like this:
preg_match("|<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=5 WIDTH=1280 HEIGHT=50>
<TR VALIGN=TOP>
<TD WIDTH=1280 BGCOLOR=WHITE>
<FONT COLOR=BLACK SIZE=2>
(.*)
</FONT>
</TR>
</TABLE>
|",$website,$matches);
But now the return value of the function is 0, so it didn't found any matches. Only when i try this it works again:
preg_match("|<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=5 WIDTH=1280 HEIGHT=50>
<TR VALIGN=TOP>
<TD WIDTH=1280 BGCOLOR=WHITE>
<FONT COLOR=BLACK SIZE=2>
(.*)
(.*)
(.*)
(.*)
</FONT>
</TR>
</TABLE>
|",$website,$matches);
So my problem is now: How can I find the part even if the value of the table has 4 lines today and 6 tomorrow for example (i never know^^)
Thank You