php 多个数组依据内容合并成一个数组

两个数组:

Array
(
[word] => hello
[translation] => 你好
[explains] => n. 表示问候, 惊奇或唤起注意时的用语,int. 喂;哈罗,n. (Hello)人名;(法)埃洛
[uk-phonetic] => 英[hə'ləʊ; he-]
[us-phonetic] => 美[hɛˈlo, hə-]
)

Array
(
[0] => n. 表示问候, 惊奇或唤起注意时的用语
[1] => int. 喂;哈罗
[2] => n. (Hello)人名;(法)埃洛)
)

合并后效果:
Array
(
[word] => hello
[translation] => 你好
[explains] => Array (
[0] => n. 表示问候, 惊奇或唤起注意时的用语
[1] => int. 喂;哈罗
[2] => n. (Hello)人名;(法)埃洛)
)
[uk-phonetic] => 英[hə'ləʊ; he-]
[us-phonetic] => 美[hɛˈlo, hə-]
)

$a = Array
(
[word] => hello
[translation] => 你好
[explains] => n. 表示问候, 惊奇或唤起注意时的用语,int. 喂;哈罗,n. (Hello)人名;(法)埃洛
[uk-phonetic] => 英[hə'ləʊ; he-]
[us-phonetic] => 美[hɛˈlo, hə-]
)

$b = Array
(
[0] => n. 表示问候, 惊奇或唤起注意时的用语
[1] => int. 喂;哈罗
[2] => n. (Hello)人名;(法)埃洛)
)

$a['explains'] = $b;
按照你说的意思,只能可以给出上面的答案
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答