How do i get the result of intersection between two Array of Objects in PHP.
For Example,
the value of $array1 is
Array
(
[0] => stdClass Object
(
[id] => 2
[influencer_id] => 2
[follower_id] => 1
)
)
and the value of $array2 is,
Array
(
[0] => stdClass Object
(
[id] => 2
[influencer_id] => 1
[follower_id] => 2
),
[1] => stdClass Object
(
[id] => 3
[influencer_id] => 3
[follower_id] => 2
),
)
So, what i want to get in $result is
Array
(
[0] => stdClass Object
(
[id] => 2
[influencer_id] => 2
[follower_id] => 1
)
)
What is the best way to get it?
Thanks in advance!