3v4l.org

run code in 500+ PHP versions simultaneously
<?php $desc = '<a href="http://mywebsite.com" cat_id="156" tab-id="3">My name</a><a href="http://mywebsite.com" cat_id="111" tab-id="4">My name 2</a>'; $dom = new DOMDocument(); $dom->loadHTML($desc); foreach ($dom->getElementsByTagName("a") as $element) { echo $element->getAttribute("cat_id"); echo "<br>"; echo $element->getAttribute("tab-id"); echo "<br>"; echo $element->nodeValue; echo "<br>"; }
Output for git.master, git.master_jit, rfc.property-hooks
156<br>3<br>My name<br>111<br>4<br>My name 2<br>

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:
60.12 ms | 1933 KiB | 4 Q