Re: String compare of 7 text strings
| From: | Hannes Magnusson | Date: | Sat, 14 Aug 2004 16:56:45 +0000 |
| Subject: | Re: String compare of 7 text strings | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-193818@lists.php.net to get a copy of this message | ||
if ( count ( array_diff ( $array, array ( $array[0] ) ) > 0 ) { // not same }
On Sun, 15 Aug 2004 00:24:30 +0800
php-general@gremlins.biz (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
> > }
> > we could post solution to this problem for ever...
>
> Indeed:
>
> if (count(array_flip($doo)) > 1) { // not same }
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> One difference between a man and a machine is that a machine is quiet
> when well oiled.
> */