On 7/28/06, weetat <[EMAIL PROTECTED]> wrote:
I need to compare values in array which populated by database , below is
the code :
Without mentioning how your code performs some unnecessary actions,
and is also full of errors, here's the idea of what you want
(untested):
[code]
// assume at first they are same
$compare = true;
// compare $array1 and $array2, assuming they have same structure
foreach($array1 as $key => $val)
{
// value doesn't match, so set $compare to false and break out of for loop
if($array2[$key] != $val) {
$compare = false;
break;
}
}
if($compare === false) {
echo 'arrays did not match.';
}
[/code]
HTH,
John W
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php