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)
[EMAIL PROTECTED]
www.phpbeginner.com
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 11:42 PM
To: [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]