3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( 'make' =>Array ( '0' =>'Volvo', '1' =>'Volvonew' ) , 'model' =>Array ( '0' =>'FH16', '1' => 123 ) , 'vehicleno' =>Array ( '0' =>'RS95SMB', '1' =>'RS95SMB' ) , 'reg_state' =>Array ( '0' =>'QLDS', '1' =>'QLDS' ) ); $i=0; $return = array(); foreach($array as $key=>$value) { $return[$i][$key] = $value[$i]; $return[$i+1][$key] = $value[$i+1]; } print_r(($return)); ?>
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.26, 8.3.0 - 8.3.14, 8.4.1
Array ( [0] => Array ( [make] => Volvo [model] => FH16 [vehicleno] => RS95SMB [reg_state] => QLDS ) [1] => Array ( [make] => Volvonew [model] => 123 [vehicleno] => RS95SMB [reg_state] => QLDS ) )

preferences:
97.08 ms | 407 KiB | 5 Q