3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0" encoding="UTF-8"?> <translations> <translation id="title"> <english name="name1" ad="ad1">Hello there, how are you?</english> <italian name="name2" ad="ad2">Ciao, come stai?</italian> </translation> <translation id="text2"> <english name="name3" ad="ad4">222Hello there, how are you?</english> <italian name="name3" ad="ad4">222Ciao, come stai?</italian> </translation> <translation id="text3"> <english name="name5" ad="ad5">333Hello there, how are you?</english> <italian name="name6" ad="ad6">333Ciao, come stai?</italian> </translation> </translations>'; $xml = new SimpleXMLElement($xml); //echo $xml->translation->english['ad'].PHP_EOL; echo $xml->translation->italian['name']; foreach ($xml->translation as $element) { foreach($element as $key => $val) { echo $element['id']."{$key}: {$val}".PHP_EOL; } }
Output for git.master, git.master_jit, rfc.property-hooks
name2titleenglish: Hello there, how are you? titleitalian: Ciao, come stai? text2english: 222Hello there, how are you? text2italian: 222Ciao, come stai? text3english: 333Hello there, how are you? text3italian: 333Ciao, come stai?

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:
42.55 ms | 401 KiB | 8 Q