PDA

Click to See Complete Forum and Search --> : preg_match? how to read within the td tags


gilgalbiblewhee
Jul 22nd, 2008, 03:28 PM
I need the preg_match innerHTML of <td></td>.

visualAd
Jul 23rd, 2008, 06:20 AM
You don't need to use regular expressions, the DOM (http://www.php.net/DOM) extension allows you to load an HTML document and do just about anything you like with it.


$html = new DOMDocument('1.0');
$html->loadHTML($htmlString);

$tds = $html->getElementsByTagName('td');

foreach ($tds as $td) {
/* for inner XML / HTML functions - see user comment (http://uk2.php.net/manual/en/book.dom.php#73793) */
}