<?php return [ 'ID' => $id, 'title' => 'FooBar'.$id ]; }, [1, 2, 2, 3, 5]); $result[$item['ID']] = $item; return $result; }, []));
Standard input is empty
array(4) { [0]=> array(2) { ["ID"]=> int(1) ["title"]=> string(7) "FooBar1" } [1]=> array(2) { ["ID"]=> int(2) ["title"]=> string(7) "FooBar2" } [2]=> array(2) { ["ID"]=> int(3) ["title"]=> string(7) "FooBar3" } [3]=> array(2) { ["ID"]=> int(5) ["title"]=> string(7) "FooBar5" } }