3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_transpose(array $a) { $r = array(); foreach($a as $keyRow => $subArr) { foreach($subArr as $keyCol => $value) $r[$keyCol][$keyRow] = $value; } return $r; } $post = [ 'time_start'=> [ 0=> '00:00', 1=> '02:00' ], 'time_end' => [ 0 => '03:00', 1 => '05:00' ], 'time_teach' => [ 0 => '03:00', 1 => '00:00' ] ]; $newData = array_transpose($post); var_export($newData);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 'time_start' => '00:00', 'time_end' => '03:00', 'time_teach' => '03:00', ), 1 => array ( 'time_start' => '02:00', 'time_end' => '05:00', 'time_teach' => '00:00', ), )

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