I
I
Igor Tkachenko2015-09-04 13:44:50
PHP
Igor Tkachenko, 2015-09-04 13:44:50

How to compare array and return missing elements?

This is how I reveal new elements in the array:

$r = array_diff_assoc($followers_new, $followers_old);

$r contains elements that are not in $followers_old.
Now the question is how to carry out a comparison so that it would return only those elements that were in $followers_old, but they are not in $followers_new.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ad4ptec, 2015-09-04
@Ad4ptec

Need to swap arrays

$r = array_diff_assoc($followers_old, $followers_new);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question