3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = <<<EOT <html> <body> <img src="img1.jpg" /> <img src="img2.jpg" /> <a href="#"> link 1</a> <a href="page.HTML">link 2</a> </body> </html> EOT; $d = new DOMDocument(); $d->loadHTML($str); $sx = simplexml_import_dom($d); foreach ($sx->xpath('') as $v) { echo $v->getName() . "\n"; }