n1ghtie
9/5/2017 - 9:34 AM

check if 2 arrays are the same in php

check if 2 arrays are the same in php

private function array_equal($a, $b) {
	    return (
	         is_array($a) 
	         && is_array($b) 
	         && count($a) == count($b) 
	         && array_diff($a, $b) === array_diff($b, $a)
	    );
	}