3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <div data-image-id="344231" style="height: 399.333px; background-image: url('/website/view_image/344231/medium'); background-size: contain;"></div> HTML; $doc = new DOMDocument(); $doc->loadHTML($html); $elm = $doc->getElementsByTagName("div"); $result = array (); $style = $doc->getElementsByTagName("div")->item(0)->getAttribute("style"); foreach (explode("; ", $style) as $str) if (preg_match ('/background-image: url\(([^)]+)\)/', $str, $matches)) { $result[] = $matches[1]; } echo $result[0];
Output for git.master, git.master_jit, rfc.property-hooks
'/website/view_image/344231/medium'

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:
28.63 ms | 405 KiB | 5 Q