3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $placementPerCampaign = array(0=> array('placement_id' => '123', 'placement_name' => '123 N'), 1=> array('placement_id' => '456', 'placement_name' => '456 N')); foreach ($placementPerCampaign as $placement) { $placementId = $placement['placement_id']; $placementName = $placement['placement_name']; $placementList[] = array('id' => $placementId, 'name' =>$placementName); } print_r($placementList);
Output for 4.3.0 - 7.2.0
Array ( [0] => Array ( [id] => 123 [name] => 123 N ) [1] => Array ( [id] => 456 [name] => 456 N ) )