3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version = "1.0" encoding = "utf-8"?> <tutorialspoint> <course category = "JAVA"> <title lang = "en">Java</title> <tutor>Gopal</tutor> <duration>3</duration> <price>$30</price> </course> <course category = "HADOOP"> <title lang = "en">Hadoop</title>. <tutor>Satish</tutor> <duration>3</duration> <price>$50</price> </course> <course category = "HTML"> <title lang = "en">html</title> <tutor>raju</tutor> <duration>5</duration> <price>$50</price> </course> <course category = "WEB"> <title lang = "en">Web Technologies</title> <tutor>Javed</tutor> <duration>10</duration> <price>$60</price> </course> </tutorialspoint>'; $arr = []; $array = json_decode(json_encode((array)simplexml_load_string($xml)),true); if ( ! empty($array)) { $i=0; foreach ($array['course'] as $elem) { $arr[$i]['title'] = $elem['title']; $arr[$i]['tutor'] = $elem['tutor']; $arr[$i]['duration'] = $elem['duration']; $arr[$i]['price'] = $elem['price']; ++$i; } } echo '<pre>';print_r($arr);echo '</pre>';
Output for git.master, git.master_jit, rfc.property-hooks
<pre>Array ( [0] => Array ( [title] => Java [tutor] => Gopal [duration] => 3 [price] => $30 ) [1] => Array ( [title] => Hadoop [tutor] => Satish [duration] => 3 [price] => $50 ) [2] => Array ( [title] => html [tutor] => raju [duration] => 5 [price] => $50 ) [3] => Array ( [title] => Web Technologies [tutor] => Javed [duration] => 10 [price] => $60 ) ) </pre>

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