3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <Response id="responceidgoeshere"> <block name="addresses"> <block> <a name="building" format="text">#NAME/NUM#</a> <a name="sub-premise" format="text">#SUB-PREM#</a> <a name="street" format="text">#STREET#</a> <a name="locality" format="text">#LOCAL#</a> <a name="city" format="text">#CITY#</a> <a name="postcode" format="text">#POSTCODE#</a> <a name="ref" format="text">#REF#</a> <a name="csscode" format="text">#CSS#</a> </block> <block> <a name="building" format="text">#NAME/NUM#</a> <a name="street" format="text">#STREET#</a> <a name="locality" format="text">#LOCAL#</a> <a name="city" format="text">#CITY#</a> <a name="postcode" format="text">#POSTCODE#</a> <a name="ref" format="text"/> <a name="csscode" format="text"/> </block> </block> </Response> XML; $sxml = simplexml_load_string($xml); $result = []; foreach ($sxml->block->block as $block) { $row = []; foreach ($block->a as $a) { $row[(string) $a['name']] = (string) $a; } $result[] = $row; } print_r($result);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [building] => #NAME/NUM# [sub-premise] => #SUB-PREM# [street] => #STREET# [locality] => #LOCAL# [city] => #CITY# [postcode] => #POSTCODE# [ref] => #REF# [csscode] => #CSS# ) [1] => Array ( [building] => #NAME/NUM# [street] => #STREET# [locality] => #LOCAL# [city] => #CITY# [postcode] => #POSTCODE# [ref] => [csscode] => ) )

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:
332.54 ms | 407 KiB | 5 Q