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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -