RE: [PHP] Tough comparison problem.

From: Date: Thu, 26 Apr 2001 15:30:48 +0000
Subject: RE: [PHP] Tough comparison problem.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-50471@lists.php.net to get a copy of this message
PHP3? too bad... PHP4 has a magic array_intersect (php.net/array_intersect) try to see php.net/arrays you might find what suits you. you're double loop will slow your application dramatically. but if it's the only way... Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) maxim@phpbeginner.com www.phpbeginner.com -----Original Message----- From: blawson@vvm.com [mailto:blawson@vvm.com] Sent: Thursday, April 26, 2001 11:42 PM To: php-general@lists.php.net Subject: [PHP] Tough comparison problem. 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. I'm using php3, so I don't have an actual "foreach" loop to pick out the array elements. Instead, I use: while(list(, $element)=each($array)){ Basically, here's what I need to do: Pull element 1 out of array 1, Compare it to all elements of array 2, Do something (if-else) based on the results of that comparison, Pull element 2 out of array 1, Compare it to all elements of array 2, and so on until all elements of array 1 have been compared to all elements of array 2. Any help is greatly appreciated! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#50471) next »