- var_dump: documentation ( source)
<?php
$input = <<< HTML
<a>some stuff we don not want</a>
<table cellpadding="2" cellspacing="1" bgcolor="#A0A0A0">
</table>
<table id="anothertable">
</table>
HTML;
$dom = new DOMDocument();
$dom->loadHTML($input);
foreach ($dom->getElementsByTagName('table') as $element) {
var_dump($element);
}