我有兩個大數組,每個數字大約有1000個,每天都在增長。 我怎麼能在array1[]['uid']
和array2[][7]
PHP合併數組的值相同
合併這個數組合併爲一個由值請注意,正確的值可以是例如array1[45]['uid']
和array2[155][7]
或 array1[444]['uid']
和array2[666][7]
等
array1
0 =>
array
'login' => string '104' (length=5)
'uid' => string '1363861889.100' (length=14)
1 =>
array
'login' => string '131' (length=5)
'uid' => string '1363863722.126' (length=14)
etc...
,另一個
array2
0 =>
array
0 => string '2013' (length=4)
1 => string '03' (length=2)
2 => string '25' (length=2)
3 => string '15' (length=2)
4 => string '39' (length=2)
5 => string '49' (length=2)
6 => string 'anonymous' (length=9)
7 => string '1363863722.126' (length=19)
1 =>
array
0 => string '2013' (length=4)
1 => string '03' (length=2)
2 => string '25' (length=2)
3 => string '12' (length=2)
4 => string '39' (length=2)
5 => string '42' (length=2)
6 => string 'anonymous' (length=9)
7 => string '1363861889.100' (length=19)
etc...
array1[0]['uid']
這裏的值相同array2[1][7]
我希望得到:
array
0 => string '2013' (length=4)
1 => string '03' (length=2)
2 => string '25' (length=2)
3 => string '12' (length=2)
4 => string '39' (length=2)
5 => string '42' (length=2)
6 => string 'anonymous' (length=9)
7 => string '1363861889.100' (length=19)
'login' => string '104' (length=5)
'uid' => string '1363861889.100' (length=14)
這個http://www.php.net/manual的/en/function.array-merge-recursive.php? – 2013-03-26 17:13:49