I would appreciate a little help . I have tried array_diff()
, intersect combos but not able to get my expected return.
Here is an example what i want to do.
First array.
Array
(
[0] => 21
[1] => 2
[2] => 1
[3] => 2
)
Second array
Array
(
[0] => 21
[1] => 2
)
using array_diff(firstarray, secondarray)
i get following.
Array
(
[2] => 1
)
But what i want
Array
(
[2] => 1
[3] => 2
)
keys from firstarray and secondarray wont necessarily be same.