3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ "john.smith@domain.com:John", "jane.doe@domain.com:Jane" ]; function customArray($data){ $final = []; $i = 0; foreach($data as $k => $v){ $splitted = explode(":",$v); $final[$i]['user_email'] = $splitted[0]; $final[$i]['user_name'] = $splitted[1]; $i++; } return $final; } print_r(customArray($data));
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [user_email] => john.smith@domain.com [user_name] => John ) [1] => Array ( [user_email] => jane.doe@domain.com [user_name] => Jane ) )

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