3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xmlstring = " <xml> <SHOP> <SHOPITEM> <ITEM_ID>item id</ITEM_ID> <SKU>item SKU </SKU> <PRODUCT>Product name</PRODUCT> <DESCRIPTION>Item descirption</DESCRIPTION> <URL> https://www.itemurl.com/item </URL> <IMGURL> https://www.itemurl.com/itemimg.jpg </IMGURL> <IMG_ALTERNATIVE> https://www.itemurl.com/itemimg2.jpg </IMG_ALTERNATIVE> <IMG_ALTERNATIVE> https://www.itemurl.com/itemimg3.jpg </IMG_ALTERNATIVE> </SHOPITEM> </SHOP> </xml> "; $array = array(); $xml = new SimpleXMLElement($xmlstring); foreach ($xml->SHOP->SHOPITEM as $element) { foreach($element as $key => $val) { array_push ( $array,"{$key}: {$val}"); } } print_r($array);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => ITEM_ID: item id [1] => SKU: item SKU [2] => PRODUCT: Product name [3] => DESCRIPTION: Item descirption [4] => URL: https://www.itemurl.com/item [5] => IMGURL: https://www.itemurl.com/itemimg.jpg [6] => IMG_ALTERNATIVE: https://www.itemurl.com/itemimg2.jpg [7] => IMG_ALTERNATIVE: https://www.itemurl.com/itemimg3.jpg )

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