
September 12th, 2008, 11:34 AM
|
 |
Likely to be eaten by a grue.
|
|
Join Date: Oct 2006
Location: Pennsylvania, USA
|
|
This will give you all the contents of the <td> fields:
PHP Code:
$string = <<<STRING
<table width="430" border="0" cellpadding="4"> <tr> <td width="122" valign="top"><img src="graphics/ice_logo_1.gif"></td> <td width="130" valign="top"><p class="style3"><strong>Home Broadband</strong><br /><span class="tool">Wireless <a href="" title=""> <img src="graphics/tooltip.gif" width="10" height="10" border="0"></a></span><br /><em>Cont </em> (36:1) <a href="" title=""><img src="graphics/tooltip.gif" width="10" height="10" border="0"></a><br> </p></td> <td width="100" valign="top"><span class="style3"> <em>Dn</em> 3Mbps <em><a href="" title=""> <img src="graphics/tooltip.gif" width="10" height="10" border="0"></a></em><br> <em>Up</em> 1Mbps</span> <span><em><a href="" title=""><strong><img src="graphics/tooltip.gif" width="10" height="10" border="0"></strong></a></em></span></td> <td width="78" align="right" valign="top"><p> €37.99 <a href="test" title=""> <strong><img src="graphics/tooltip.gif" width="10" height="10" border="0"></strong></a><br /> </p> </td> </tr> </table>
STRING;
preg_match_all("#<td[^>]*>(.+?)</td#", $string, $foo);
print_r($foo[1]);
However, it also includes plenty of HTML. If the HTML is properly formed, you can use the DOM document model to parse it, but I personally like using regexp for this sort of thing.
-Dan
__________________
HEY! YOU! Read the New User Guide and Forum Rules
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
|