Есть 2 массива $example1 и $example2
$example1 = array(
array(
"ID" => 1,
"SECTION_ID" => 1355,
"NAME" => "name"
),
array(
"ID" => 2,
"SECTION_ID" => 2654,
"NAME" => "name"
),
array(
"ID" => 3,
"SECTION_ID" => 1355,
"NAME" => "name"
),
array(
"ID" => 4,
"SECTION_ID" => 7345,
"NAME" => "name"
),
);
$example2 = array(
array(
"ID" => 1,
"SECTION_ID" => 1355,
"VALUE" => "value1"
),
array(
"ID" => 2,
"SECTION_ID" => 2654,
"VALUE" => "value2"
),
array(
"ID" => 3,
"SECTION_ID" => 7345,
"VALUE" => "value3"
),
);
Как из массива example2 значение "VALUE" присвоить к массиву example1 по значению ключа "SECTION_ID", при этом, чтобы не пропадал элемент с повторяющимся "SECTION_ID".
Пример, что должно получиться:
$example3 = array(
array(
"ID" => 1,
"SECTION_ID" => 1355,
"NAME" => "name1",
"VALUE" => "value1",
),
array(
"ID" => 2,
"SECTION_ID" => 2654,
"NAME" => "name2",
"VALUE" => "value2"
),
array(
"ID" => 3,
"SECTION_ID" => 1355,
"NAME" => "name3",
"VALUE" => "value1"
),
array(
"ID" => 4,
"SECTION_ID" => 7345,
"NAME" => "name4",
"VALUE" => "value3"
),
);