3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sHtml = '<p>the info that i really need is here<p> <p class="text-right"><a class="btn btn-default espbott aplus" role="button" href="brand/google.html">Google</a></p>'; $sHtml = '<div id="wrapper">' . $sHtml . '</div>'; echo "org:\n"; echo $sHtml; echo "\n\n"; $doc = new DOMDocument(); $doc->loadHtml($sHtml); foreach( $doc->getElementsByTagName( 'a' ) as $element ) { $element->parentNode->removeChild( $element ); } echo "res:\n"; echo $doc->saveHTML($doc->getElementById('wrapper')); ?>
Output for git.master, git.master_jit, rfc.property-hooks
org: <div id="wrapper"><p>the info that i really need is here<p> <p class="text-right"><a class="btn btn-default espbott aplus" role="button" href="brand/google.html">Google</a></p></div> res: <div id="wrapper"><p>the info that i really need is here</p><p> </p><p class="text-right"></p></div>

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:
129.02 ms | 406 KiB | 5 Q