Array A
[0] => stdClass Object
(
[id] => 1542
[id_restaurant] => 303
[name] => Café da Manhã
[hour] => 10:15:00
[quantity] => 10
[peoples] => 6
[weekday] => 1
[is_available] => 1
[created_at] => 2018-09-21 16:28:23
[updated_at] => 2018-09-21 16:28:23
)
[1] => stdClass Object
(
[id] => 1543
[id_restaurant] => 303
[name] => Almoço
[hour] => 16:00:00
[quantity] => 10
[peoples] => 6
[weekday] => 1
[is_available] => 1
[created_at] => 2018-09-21 16:28:23
[updated_at] => 2018-09-21 16:28:23
)
[2] => stdClass Object
(
[id] => 1544
[id_restaurant] => 303
[name] => Janta
[hour] => 17:45:00
[quantity] => 10
[peoples] => 6
[weekday] => 1
[is_available] => 1
[created_at] => 2018-09-21 16:28:23
[updated_at] => 2018-09-21 16:28:23
)
[3] => stdClass Object
(
[id] => 1545
[id_restaurant] => 303
[name] => Café da Manhã
[hour] => 10:45:00
[quantity] => 20
[peoples] => 6
[weekday] => 2
[is_available] => 1
[created_at] => 2018-09-21 16:28:23
[updated_at] => 2018-09-21 16:28:23
)
Array B
[0] => stdClass Object
(
[id] => 1540
[id_restaurant] => 303
[name] => Café da Manhã
[hour] => 10:15:00
[quantity] => 10
[peoples] => 6
[weekday] => 1
[is_available] => 1
[created_at] => 2018-09-21 16:28:23
[updated_at] => 2018-09-21 16:28:23
)
[1] => stdClass Object
(
[id] => 1599
[id_restaurant] => 303
[name] => Almoço
[hour] => 16:00:00
[quantity] => 10
[peoples] => 6
[weekday] => 1
[is_available] => 1
[created_at] => 2018-09-21 16:28:23
[updated_at] => 2018-09-21 16:28:23
)
[2] => stdClass Object
(
[id] => 1544
[id_restaurant] => 303
[name] => Janta
[hour] => 17:45:00
[quantity] => 10
[peoples] => 6
[weekday] => 1
[is_available] => 1
[created_at] => 2018-09-21 16:28:23
[updated_at] => 2018-09-21 16:28:23
)
[3] => stdClass Object
(
[id] => 1545
[id_restaurant] => 303
[name] => Café da Manhã
[hour] => 10:45:00
[quantity] => 20
[peoples] => 6
[weekday] => 2
[is_available] => 1
[created_at] => 2018-09-21 16:28:23
[updated_at] => 2018-09-21 16:28:23
)
I have 2 arrays A and B ... I need to remove from both arrays elements whose ids are not in both arrays A and B eg: ids 1544 and 1545 exist in both arrays, which do not exist remove from both arrays.