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 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 ----- > 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 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 huge if/then statement? > > Thanks, > Brent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php