3v4l.org

run code in 300+ PHP versions simultaneously
<?php $firstarray = array ( Array ( 'id' => 863, 'flag' => 2, 'qty' => 2, 'size' => 8 ), Array ( 'id' => 861, 'flag' => 2, 'qty' => 2, 'size' => 8 ) ); $twoarray = array ( '863' => "Bead Headed Prince Nymphs size 18", '861' => "Bead Headed Prince Nymphs size 14" ); // Make firstarray associative $firstarray = array_column($firstarray, NULL,"id"); Foreach($twoarray as $key => $val){ $firstarray[$key]['name'] = $val; } Var_dump($firstarray);
Output for git.master_jit, git.master, rfc.property-hooks
array(2) { [863]=> array(5) { ["id"]=> int(863) ["flag"]=> int(2) ["qty"]=> int(2) ["size"]=> int(8) ["name"]=> string(33) "Bead Headed Prince Nymphs size 18" } [861]=> array(5) { ["id"]=> int(861) ["flag"]=> int(2) ["qty"]=> int(2) ["size"]=> int(8) ["name"]=> string(33) "Bead Headed Prince Nymphs size 14" } }

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