基于相同ID合并两个或多个多维数组
所有数组都来自不同的表 我
的目标:尝试将所有数组合并在一起并获取数据以查看页表
我正在为我的项目使用代码点火器框架工作。
array1 从"成员"表中获取 数组 2、数组 3 和 array4 从"注册"表中
获取
Array
(
[1] => stdClass Object
(
[mem_tbl_id] => 1
[m_name_e] => Titus C.
[member_id] => KZI37M3025
[gender] => Male
[m_number] => 9489455057
[familyid] => KZI54F2256
)
[2] => stdClass Object
(
[mem_tbl_id] => 2
[m_name_e] => Baby Helen
[member_id] => KZI45M6402
[gender] => Female
[m_number] =>
[familyid] => KZI54F2256
)
[3] => stdClass Object
(
[mem_tbl_id] => 3
[m_name_e] => Satheesh Premananth T.
[member_id] => KZI69M3438
[gender] => Male
[m_number] =>
[familyid] => KZI69F5619
)
)
阵列 2
Array
(
[1] => stdClass Object
(
[mem_tbl_id] => 1
[do_birth] => 1937-09-18
)
[2] => stdClass Object
(
[mem_tbl_id] => 2
[do_birth] => 1945-02-06
)
[3] => stdClass Object
(
[mem_tbl_id] => 3
[do_birth] => 1968-04-12
)
)
阵列 3
Array
(
[3] => stdClass Object
(
[mem_tbl_id] => 3
[do_baptism] => 1969-04-13
)
)
阵列 4
Array
(
[1] => stdClass Object
(
[mem_tbl_id] => 1
[do_confirm] => 1954-04-07
)
[3] => stdClass Object
(
[mem_tbl_id] => 3
[do_confirm] => 1990-04-29
)
)
使用array_merge_recursive((;
$marger_array = array_merge_recursive($Array1, $Array2, $Array3, $Array4);
var_dump($marger_array);