PHP array_merge order one value per array -
i'd 2 merge 2 array custom order: take 1 value array 1 , 1 array 2 following:
$array1 = array('key1' => 'value_1_1', 'key2' => 'value_1_2'); $array2 = array('key1' => 'value_2_1', 'key2' => 'value_2_2'); //merge array custom order $array_result = array('key1' => array('value_1_1', 'value_2_1'), 'key2' => array('value_2_1', 'value_2_2') )
values different, keys same on both arrays.
built-in function
$result = array_merge_recursive($array1, $array2);
Comments
Post a Comment