3v4l.org

run code in 300+ PHP versions simultaneously
<?php // vim: ts=3 sw=3 sts=3 et $body = file_get_contents('http://www.google.com'); libxml_use_internal_errors(true); $dom = new DOMDocument; $dom->loadHTML($body); $xpath = new DOMXPath($dom); $found = $xpath->query( '//a[ not(starts-with(normalize-space(@href), "http://")) and not(starts-with(normalize-space(@href), "https://")) ]'); header('content-type: text/plain'); foreach ($found as $node) { var_dump($node->getAttribute('href')); }

preferences:
32.44 ms | 402 KiB | 5 Q