there is now an array of array An and another array of data. The first part of
is to find the corresponding array A from the array data.
requires the same four key-value pairs, that is, id,name,info1,info2.
then compare after finding, if ext1 is not empty An array. If empty, the data of the corresponding data array is used, and the value of the ext2 key of the data array is changed to 1, and everything else remains the same.
forms a new array newdata.
$arrA = [
[
"id" => "1",
"name" => "3",
"info1" => "1",
"info2" => "a",
"ext1" => "1",
"ext2" => "a",
"ext3" => "1",
],
$arrData = array (
"0" => [
"id" => "1",
"name" => "3",
"info1" => "1",
"info2" => "a",
"ext1" => "1",
"ext2" => "a",
"ext3" => "1",
],
"1" => [
"id" => "2",
"name" => "3",
"info1" => "1",
"info2" => "a",
"ext1" => "1",
"ext2" => "a",
"ext3" => "1",
],
],
"2" => [
"id" => "3",
"name" => "2",
"info1" => "1",
"info2" => "a",
"ext1" => "1",
"ext2" => "a",
"ext3" => "1",
],
);