3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <div> <img src="http://3.bp.blogspot.com/-ulEY6FtwbtU/Twye18FlT4I/AAEE/CU2Q/s320/DSC_0045.JPG"> <img src="blogspot/foo.jpg"> <iframe src="blogspot/bar.avi"></iframe> <img src="https://blogspot.com/image.png"> </div> HTML; $doc = new DOMDocument(); $doc->loadHTML($html); $xpath = new DOMXPath($doc); $result = []; foreach ($xpath->query("//img[contains(@src, 'blogspot')]/@src") as $src) { $result[] = $src->nodeValue; } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 'http://3.bp.blogspot.com/-ulEY6FtwbtU/Twye18FlT4I/AAEE/CU2Q/s320/DSC_0045.JPG', 1 => 'blogspot/foo.jpg', 2 => 'https://blogspot.com/image.png', )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
31.65 ms | 405 KiB | 5 Q