Hello,

I am trying to store in an array the content of <tr> elements in a page. A sample of the page's code looks like this:

7E7"><img src="inxclus/flags/ES.gif"></td> </tr> <tr> <td height=20 bgcolor="#FFFFFF"><b>asdsdsdf</b></i></td> <td bgcolor="#FFFFFF"><a href="./asdf.php?pid=10460">asdsdsdf</a></td> <td bgcolor="#FFFFFF">asdfasdf</td> <td align="center" bgcolor="#FFFFFF"> <img src="img/note.png"></td> <td align="center" bgcolor="#FFFFFF"><img src="inxclus/flags/ES.gif"></td> </tr> <tr> <td height=20 bgcolor="#E7E7E7"><b>asdf</b></i></td> <td bgcolor="#E7E7E7"><a href="./asdf.php?pid=10458">asdsdsdf</a></td> <td bgcolor="#E7E7E7">asdsdsdf</td> <td align="center" bgcolor="#E7E7E7"> <img src="img/note.png"></td> <td align="center" bgcolor="#E7E7E7"><img src="inxclus/flags/ES.gif"></td> </tr> <tr> <td height=20 bgcolor="#FFFFFF"><b>asdsdsdf</b></i></td> <td bgcolor="#FFF

I have played around with patterns similar to this one:

$blockPattern = '~<tr> <td height=20 bgcolor="#(E7E7E7|FFFFFF)"><b>.[^(<tr>)]+gif"></td> </tr>~';

But of course that doesn't work. Obviously i'm missing something here, any help?

Thanks

Well i fixed it, used

<tr> <td height=20 bgcolor="#(E7E7E7|FFFFFF)"><b>.+?gif"></td> </tr>

Plus i just realized that parentheses don't work inside [] :P

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.