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 v
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 Associat
* 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.
--
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]
>
>
-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 output
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
ECTED]>
> 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
From: "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 st
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 hu
9 matches
Mail list logo