3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "Name,Age,Location Jo,28,London Do,35,London"; $arr= explode("\n", $str); $keys = explode(",",array_shift($arr)); Foreach($arr as $line){ $new[]= array_combine($keys, explode(",", $line)); } Var_dump($new);
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> array(3) { ["Name"]=> string(2) "Jo" ["Age"]=> string(2) "28" ["Location"]=> string(6) "London" } [1]=> array(3) { ["Name"]=> string(2) "Do" ["Age"]=> string(2) "35" ["Location"]=> string(6) "London" } }

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