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

Re: [PHP] String compare of 7 text strings

2004-08-13 Thread Brent Clements
Let me rephase my question in my previous email: I'd like to compare 7 strings(which are in an array). Each string should be the same, if they are not, a message should be outputted. How would one do this outside of using a huge if/then statement? Thanks, Brent - Original Message -

Re: [PHP] String compare of 7 text strings

2004-08-13 Thread Hannes Magnusson
sort ( $array ); if ( $array[ 0 ] !== $array[ count ( $array )-1 ] ) { // Not all fields in the array are the same... } On Fri, 13 Aug 2004 21:10:50 -0500 [EMAIL PROTECTED] (Brent Clements) wrote: Let me rephase my question in my previous email: I'd like to compare 7 strings(which are in

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