Answer the question
In order to leave comments, you need to log in
How to collect to collect the third from two arrays?
There are two arrays
first
array (size=148)
0 =>
array (size=6)
'id_1' => string '1' (length=1)
'id_2' => string '6' (length=2)
'text' => string 'Lorem ipsum' (length=16)
'insert_time' => string '0000-00-00 00:00:00' (length=19)
'update_time' => string '0000-00-00 00:00:00' (length=19)
'is_check' => string '0' (length=1)
1 =>
array (size=6)
'id_1' => string '1' (length=1)
'id_2' => string '2' (length=2)
'text' => string 'Lorem ipsum' (length=16)
'insert_time' => string '0000-00-00 00:00:00' (length=19)
'update_time' => string '0000-00-00 00:00:00' (length=19)
'is_check' => string '0' (length=1)
...
array (size=221)
0 =>
array (size=3)
'id_2' => string '6' (length=2)
'title' => string 'ipsum' (length=30)
'address' => string 'lorem' (length=42)
1 =>
array (size=3)
'id_2' => string '2' (length=2)
'title' => string 'lorem' (length=30)
'address' => string 'ipsum' (length=39)
...
0 =>
array (size=3)
'id_1' => string '1' (length=1)
'text' => string 'Lorem ipsum' (length=16)
'insert_time' => string '0000-00-00 00:00:00' (length=19)
'update_time' => string '0000-00-00 00:00:00' (length=19)
'value' =>
array (size=28)
0 =>
array (size=3)
'id' => string '6' (length=2)
'title' => string 'ipsum' (length=30)
'address' => string 'lorem' (length=42)
'is_check' => string '0' (length=1)
1 =>
array (size=3)
'id' => string '2' (length=2)
'title' => string 'ipsum' (length=30)
'address' => string 'lorem' (length=42)
'is_check' => string '0' (length=1)
Answer the question
In order to leave comments, you need to log in
Foreach ($arr1 as $num=>&$el) {
$el[your key] = $arr2[$num][more key];
.......
$el[value] = $arr2;
Foreach ($el[value] as &$one) {
$one['is_check'] = $el['is_check'];
}
}
// deliver the quotes yourself, from the phone ☺️ inconvenient)).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question