Created
October 25, 2012 23:30
-
-
Save jfranciscos4/3956127 to your computer and use it in GitHub Desktop.
Compara dois array (key and values)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// devel-takethisout-oper.web@gmail.com 17-Oct-2012 08:31 | |
// Compares two arrays- keys and values (as strings) must match. | |
// Keys and order must be the same to be equal. | |
function arraysEqual($arr1, $arr2){ | |
if(count($arr1) != count($arr2)){ | |
return(FALSE); | |
}else{ | |
$arrStr1 = serialize($arr1); | |
$arrStr2 = serialize($arr2); | |
if( strcmp($arrStr1, $arrStr2)==0 ){ | |
return(TRUE); | |
}else{ | |
return(FALSE); | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment