I have opened an HTML file using
file_get_contents(\'http://www.example.com/file.html\')
and want to parse the line including \"ParseThis\"
Since it is the first h1 tag, getting it should be fairly trivial:
$doc = new DOMDocument(); $doc->loadHTML($html); $h1 = $doc->getElementsByTagName('h1'); echo $h1->item(0)->nodeValue;
http://php.net/manual/en/class.domdocument.php