$doc=new DOMDocument();
$doc->loadHTML($str);
$doc->getElementById("MainTable")->getAttribute("id");
Displays the error
Fatal error: Call to a member function getAttribute() on a non-object
Oh and $str is the HTML of a page :p
D: Am I doing something wrong? :o