Quantcast
Channel: PHP compare array - Stack Overflow
Viewing all articles
Browse latest Browse all 19

PHP compare array

$
0
0

Is there anyway to compare arrays in php using an inbuilt function, short of doing some sort of loop?

$a1 = array(1,2,3);$a2 = array(1,2,3);if (array_are_same($a1, $a2)) {    // code here}

Btw, the array values will not always be in the same order.


Viewing all articles
Browse latest Browse all 19

Latest Images

Trending Articles



Latest Images