- var_dump: documentation ( source)
<?php
$html = '<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<table id="mainTable">
<tr>
<td>a</td>
</tr>
</table>
</body>
</html>';
$dom = new DOMDocument();
$dom->loadHTML($html);
$table = $dom->getElementById('mainTable');
$rowArr = $table->getElementsByTagName('tr');
var_dump($rowArr);