Re: compareing variables

From: Date: Sat, 18 May 2002 00:10:48 +0000
Subject: Re: compareing variables
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-19243@lists.php.net to get a copy of this message
"Crosswalkcentral" <webmaster@crosswalkcentral.net> wrote in message news:20020517235946.61499.qmail@pb1.pair.com... > I am usinf the usual if statement here > > If ($dservice == $olddservice) { > Echo ("TRUE"); > exit(); > } > > My question is that if $dservices = Main and $olddservice = main then the > above statement will not display TRUE. > > How can i get it to were it will see that Main is the same as main and so > on? (a) convert to a standard case: if (strtolower($dservice) == strtolower($olddservice)) { // whatever... } (b) use a case-insensitive comparison: if (strcasecmp($dservice, $olddservice) == 0) { // whatever... }

« previous php.db (#19243) next »