Re: Tough comparison problem.
| From: | Pavel Jartsev | Date: | Thu, 26 Apr 2001 15:10:24 +0000 |
| Subject: | Re: Tough comparison problem. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-50468@lists.php.net to get a copy of this message | ||
"blawson@vvm.com" wrote:
>
> I've got two functions that return data in an array. I need to compare the
> individual elements of one array against the elements of another, and do
> something within an if-else statement.
>
> ...
>
If i didn't misunderstood Your question, then this double-loop should
do the thing:
<?
$arr1=array('a'=>'aa','b'=>'bb');
$arr2=array('c'=>'cc','d'=>'cc');
for(reset($arr1);$i=key($arr1);next($arr1)){
for(reset($arr2);$j=key($arr2);next($arr2)){
/*
* compare here $arr1[$i] with $arr2[$j] and do something
*/
...
}
}
?>
--
Pavel a.k.a. Papi