数组 #1 看起来像这样(简化):
Array
(
[Appetizers] => Array
(
[0] => Array
(
[category] => Appetizers
[name] => Beef Tenderloin Carpaccio
)
[1] => Array
(
[category] => Appetizers
[name] => Calamari Fritto Misto
)
)
[Flatbreads] => Array
(
[0] => Array
(
[category] => Flatbreads
[name] => Quattro Formaggi
)
[1] => Array
(
[category] => Flatbreads
[name] => Tomato & Burrata
)
)
)
数组 #2 如下所示:
Array
(
[0] => Array
(
[category] => Appetizers
[note] => Choose One Item From Each Category
)
[1] => Array
(
[category] => Flatbreads
[note] => with Shoestring or Wedge Potatoes
)
)
基于数组#1 的类别键与数组#2 的“类别”值的匹配,我如何能够将数组#2 中的['note'] 合并到数组#1 中?所以结果是这样的:
Array
(
[Appetizers] => Array
(
[0] => Array
(
[category] => Appetizers
[name] => Beef Tenderloin Carpaccio
[note] => Choose One Item From Each Category
)
[1] => Array
(
[category] => Appetizers
[name] => Calamari Fritto Misto
[note] => Choose One Item From Each Category
)
)
[Flatbreads] => Array
(
[0] => Array
(
[category] => Flatbreads
[name] => Quattro Formaggi
[note] => with Shoestring or Wedge Potatoes
)
[1] => Array
(
[category] => Flatbreads
[name] => Tomato & Burrata
[note] => with Shoestring or Wedge Potatoes
)
)
)