我有两个数组,由结果填充。
1) users_facebook & 2) users_twitter
Array
(
[users_facebook] => Array
(
[0] => Array
(
[id] => "180",
[email] => "",
[first_name] => "Djon",
[last_name] => "Katview"
),
[1] => Array
(
[id] => "182",
[email] => "",
[first_name] => "Awaaru",
[last_name] => "Bhejafry"
)
),
[users_twitter] => Array
(
[0] => Array
(
[id] => "180",
[email] => "",
[first_name] => "Djon",
[last_name] => "Katview"
),
[1] => Array
(
[id] => "181",
[email] => "",
[first_name] => "Kavritis",
[last_name] => "Abrfafda"
),
[2] => Array
(
[id] => "182",
[email] => "",
[first_name] => "Awaaru",
[last_name] => "Bhejafry"
)
),
)
我想在两个数组中选择具有相同“id”的元素并将其附加到新数组中,比如“users_final_array”
当它附加到新数组时,我想从两个数组中删除它。
ps : 不匹配的元素必须保持原样.. 近 3 小时以来我一直在搞乱它
添加:
结果数组将如下所示:
Array
(
[users_facebook] => Array
(
),
[users_twitter] => Array
(
[0] => Array
(
[id] => "181",
[email] => "",
[first_name] => "Kavritis",
[last_name] => "Abrfafda"
)
),
[users_final_array] => Array
(
[0] => Array
(
[id] => "180",
[email] => "",
[first_name] => "Djon",
[last_name] => "Katview"
),
[1] => Array
(
[id] => "182",
[email] => "",
[first_name] => "Awaaru",
[last_name] => "Bhejafry"
)
),
)