3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'product_template_id' => [ '0' => '1', '1' => '2' ], 'amount' => [ '0' => '50', '1' => '100' ] ]; $arr = []; for ($x = 0; $x <= count($array['amount']); $x ++) { $arr[$x] = [ 'product_template_id' => $array['product_template_id'][$x], 'amount' => $array['amount'][$x], ]; } var_dump($arr);

preferences:
46.24 ms | 402 KiB | 5 Q