Is there a built-in function for PHP for me to check whether two arrays contain the same values ( order not important?).
For example, I want a function that returns
You only need to compare one-way using array_diff() and use count() for the inverted relationship.
count()
if (count($a1) == count($a2) && !array_diff($a1, $a2)) { // equal arrays }