0
私は別の配列とマージしたい次の配列を持っています。値の配列をマージする
2つの配列:(実際には応答にはもっと多くの項目がありますが、現在は特定の値で配列をマージしたいと思います)。
array (size=5)
'_index' => string 'pagespeed' (length=9)
'_type' => string 'ecostylenlresult' (length=16)
'_id' => string 'AVSaAaavHgv4xDNlwI0f' (length=20)
'_score' => float 1
'_source' =>
array (size=9)
'kind' => string 'pagespeedonline#result' (length=22)
'id' => string 'http://www.ecostyle.nl/' (length=23)
'responseCode' => int 200
'title' => string 'ECOstyle |' (length=10)
'ruleGroups' =>
array (size=1)
'SPEED' =>
array (size=1)
...
'pageStats' =>
array (size=10)
'numberResources' => int 60
'numberHosts' => int 7
'totalRequestBytes' => string '6997' (length=4)
'numberStaticResources' => int 56
'htmlResponseBytes' => string '40101' (length=5)
'cssResponseBytes' => string '332781' (length=6)
'imageResponseBytes' => string '2160470' (length=7)
'javascriptResponseBytes' => string '286189' (length=6)
'numberJsResources' => int 26
'numberCssResources' => int 14
'formattedResults' =>
array (size=2)
'locale' => string 'en_US' (length=5)
'ruleResults' =>
array (size=10)
...
'version' =>
array (size=2)
'major' => int 1
'minor' => int 15
0 => string 'ecostylenl_2016-05-10' (length=21)
array (size=5)
'_index' => string 'moz' (length=3)
'_type' => string 'ecostylenlresult' (length=16)
'_id' => string 'AVSaAZUbHgv4xDNlwI0c' (length=20)
'_score' => float 1
'_source' =>
array (size=12)
'fmrp' => float 5.1715406017042
'fmrr' => float 1.2509523237227E-8
'pda' => float 48.09425912773
'ueid' => int 3620
'uid' => int 7085
'umrp' => float 6.8994293440141
'umrr' => float 7.137551640113E-8
'upa' => float 56.852760548224
'us' => int 200
'ut' => string 'ECOstyle' (length=8)
'uu' => string 'www.ecostyle.nl/' (length=16)
0 =>
array (size=1)
'' => string 'ecostylenl_2016-05-10' (length=21)
私は両方とも同じ値を持っています。
0 => string 'ecostylenl_2016-05-10' (length=21)
私はこれを1つの配列にしたいので、すべての結果を1つの要素に入れます。
これを行うにはどのような方法が最適ですか?
http://stackoverflow.com/questions/14842272/php-array-merge-two-arrays-on-same-key –