php - How to merge multidimensional arrays where only subarrays are affected? -


Here: I asked a lot from them, but the array was flattering. I tried to customize the code, but unfortunately without success

How can I merge the following arrays so that the second array can not be added after the end of the first array, but get the correspondent value of each subahaha second suburb of the first array. In other words, I I want to merge the suburbs. Array01 ([0] = & gt; Array ([0] => 40292633 [1] => 412) [ARRE 01]

  1] => Array ( [0] = & gt; 41785603 [1] = & gt; 382) [2] = & gt; Array ([0] => 48792980 [1] => 373) [3] = & gt; Array ([0] => 44741143 [1] = & gt; 329))  

Array 02:

  Array02 ([0] = & Gt; Hey ([0] => 3460581 [1] => 1407424 B1 [2] => 951753) [1] => Array ([0] => 3484251 [ 1] = & gt; 1028325 B1 [2] = & gt; 15 9357) [2] = & gt; Array ([0] => 3519102 [1] => 0586365 A1 [2] = > 456654) [3] => Hey ([0] => 3529714 [1] => 1059876A1 [2] => 852258))  

Final array:

  finalArray ([0] => array [0] => 40292633 [1] => 412 [2] => 3460581 [3 ] = & Gt; 1407424 B1 [4] => 951753) [1] = & gt; Array ([0] = & gt; 41785603 [1] => 382 [2] => 3484251 [3] => 1028325 B1 [4] => 15 9 357) [2] = & Gt; Array ([0] => 48792980 [1] => 373 [2] => 3519102 [3] => 0586365 A1 [4] => 456654) [3] = & Gt; Array ([0] => 44741143 [1] => 32 9 [2] => 3529714 [3] => 1059876 A1 [4] => 852258))   

Try this code

  Function merge_array ($ a1, $ a2) {return array ($ a1, $ a2); } $ Result = array_map ("merge_arriage", $ a1, $ a2); Foreign Currency ($ result as $ nr) {$ nres [] = array_merge ($ nr [0], $ nr [1]); }  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -