3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( "1" => Array ( "0" => "16/03/2018", "1" => "Friday", "2" => "21.00", "3" => "Friendly Match", "4" => "Italy vs France", "5" => "Truesports HD", ), "2" => Array ( "0" => "17/03/2018", "1" => "Saturday", "2" => "15.30", "3" => "Friendly Match", "4" => "Italy vs Pakistan", "5" => "Truesports HD", ), "3" => Array ( "0" => "17/03/2018", "1" => "Saturday", "2" => "19.00", "3" => "Friendly Match", "4" => "Spain vs USA", "5" => "Truesports" ) ); $array_keys= array("date","day","time","type","value","tv"); $new_array = array(); foreach ($array as $key => $value) { $tmp_array = array(); foreach ($value as $key1 => $value1) { $tmp_array[$array_keys[$key1]] = $value1; } $new_array[] =$tmp_array; } echo json_encode($new_array, JSON_PRETTY_PRINT);
Output for git.master, git.master_jit, rfc.property-hooks
[ { "date": "16\/03\/2018", "day": "Friday", "time": "21.00", "type": "Friendly Match", "value": "Italy vs France", "tv": "Truesports HD" }, { "date": "17\/03\/2018", "day": "Saturday", "time": "15.30", "type": "Friendly Match", "value": "Italy vs Pakistan", "tv": "Truesports HD" }, { "date": "17\/03\/2018", "day": "Saturday", "time": "19.00", "type": "Friendly Match", "value": "Spain vs USA", "tv": "Truesports" } ]

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