RE: [PHP] String compare of 7 text strings

2004-08-14 Thread Ford, Mike [LSS]
-Original Message- From: Brent Clements To: [EMAIL PROTECTED] I wanted to see if anyone has an easier way to do this. The end result is this: I need to compare 7 different text strings(which are in an array). They should all be the same, if they are not the same, a message should be

Re: [PHP] String compare of 7 text strings

2004-08-14 Thread Hannes Magnusson
if ( count ( array_unique ( $array ) ) == 1 ) { // all fields have the same value } we could post solution to this problem for ever... - Hannes On Sat, 14 Aug 2004 15:24:03 +0100 [EMAIL PROTECTED] (Mike Ford) wrote: -Original Message- From: Brent Clements To: [EMAIL PROTECTED] I

Re: [PHP] String compare of 7 text strings

2004-08-14 Thread Kim Steinhaug
* Ed Lazor wrote : Nice solution =) My thoughts exatly, :D -- Kim Steinhaug - There are 10 types of people when it comes to binary numbers: those who understand them, and those who don't.

Re: [PHP] String compare of 7 text strings

2004-08-14 Thread Jason Wong
On Saturday 14 August 2004 23:12, Hannes Magnusson wrote: if ( count ( array_unique ( $array ) ) == 1 ) { // all fields have the same value } we could post solution to this problem for ever... Indeed: if (count(array_flip($doo)) 1) { // not same } -- Jason Wong - Gremlins Associates -

Re: [PHP] String compare of 7 text strings

2004-08-14 Thread Hannes Magnusson
if ( count ( array_diff ( $array, array ( $array[0] ) ) 0 ) { // not same } On Sun, 15 Aug 2004 00:24:30 +0800 [EMAIL PROTECTED] (Jason Wong) wrote: On Saturday 14 August 2004 23:12, Hannes Magnusson wrote: if ( count ( array_unique ( $array ) ) == 1 ) { // all fields have the same value

[PHP] String compare of 7 text strings

2004-08-13 Thread Brent Clements
I wanted to see if anyone has an easier way to do this. The end result is this: I need to compare 7 different text strings(which are in an array). They should all be the same, if they are not the same, a message should be outputted saying they weren't. How would one do this outside of using a

Re: [PHP] String compare of 7 text strings

2004-08-13 Thread Brent Clements
: Brent Clements [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 13, 2004 9:07 PM Subject: [PHP] String compare of 7 text strings I wanted to see if anyone has an easier way to do this. The end result is this: I need to compare 7 different text strings(which are in an array

Re: [PHP] String compare of 7 text strings

2004-08-13 Thread Hannes Magnusson
9:07 PM Subject: [PHP] String compare of 7 text strings I wanted to see if anyone has an easier way to do this. The end result is this: I need to compare 7 different text strings(which are in an array). They should all be the same, if they are not the same, a message should be outputted

RE: [PHP] String compare of 7 text strings

2004-08-13 Thread Ed Lazor
Nice solution =) -Original Message- sort ( $array ); if ( $array[ 0 ] !== $array[ count ( $array )-1 ] ) { // Not all fields in the array are the same... } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php