/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function compareAssociativeArrays($first_array, $second_array) { { //Arrays are different //print_r($result); will return the difference as key => value pairs. return FALSE; } else { //Arrays are same. //print_r($result); returns empty array. return TRUE; } } //Usage: 'name' => 'Zoran', 'smart' => 'not really' ); 'smart' => 'not really', 'name' => 'Zoran' ); if(compareAssociativeArrays($first, $second)) { echo 'Arrays are same'; } else { echo 'Arrays are different'; }