3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = array ( array ( 'id' => 123, 'lfsnr' => 'abc', 'aktion' => 'A' ), array ( 'id' => 123, 'artikel' => 'RGUA 3', 'menge' => '20,18' ), array ( 'id' => 456, 'lfsnr' => '22013552', 'aktion' => 'A' ), array ( 'id' => 456, 'artikel' => 'RG 0/63 UA 3', 'menge' => '20,02' ) ); $the_ids = array_column($input, 'id'); array_multisort($the_ids, SORT_ASC, $input); $output = array(); foreach($the_ids as $p){ $output[$p] = array(); } foreach($input as $i){ $id = $i['id']; foreach($i as $key => $input_identifier){ $output[$id][$key] = $input_identifier; } } $output = array_values($output); print_r($output);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [id] => 123 [artikel] => RGUA 3 [menge] => 20,18 [lfsnr] => abc [aktion] => A ) [1] => Array ( [id] => 456 [artikel] => RG 0/63 UA 3 [menge] => 20,02 [lfsnr] => 22013552 [aktion] => A ) )

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:
42.26 ms | 1459 KiB | 4 Q