我要说的是,两阵列是个阵列,其阵列是年金和类似美元。 他们拥有一个称为“姓名”的关键。 我怎么能够做到:
每年1美元
Array
(
[0] => Array
(
[name] => JOE MONROE
[year] => 1950
[info] => his ghost still haunts us
)
[1] => Array
(
[name] => FUTUREMAN
[year] => 1930
[info] => RIP
)
)
以及这种类型的美元
Array
(
[0] => Array
(
[name] => JOE MONROE
[likes] => cornbread
[dislikes] => pain
)
[1] => Array
(
[name] => E. Case
[likes] => chaos
[dislikes] => order
)
[2] => Array
(
[name] => FUTUREMAN
[likes] => mustard
[dislikes] => mayo
)
)
可将第2阵列中的信息添加到第1号,如果“名称”价值与下列内容相匹配:
Array
(
[0] => Array
(
[name] => JOE MONROE
[year] => 1950
[info] => his ghost still haunts us
[likes] => cornbread
[dislikes] => pain
)
[1] => Array
(
[name] => FUTUREMAN
[year] => 1930
[info] => RIP
[likes] => mustard
[dislikes] => mayo
)
)
我审视了已经提出的问题,但看不到什么,也许用错误术语描述问题。 我 st着ach子,因为如果我这样说的话,那就不了。
foreach (每年1美元 as $y){
$complete[]=array( name =>$y[ name ], year =>$y[ year ], info =>$y[ info ], likes =$likes_dislikes[0][ likes ], dislikes =>$likes_dislikes[0][ dislikes ] )
}
我只想给所有人带来同样的价值观。 这样做的最简单方式是什么?