Re: compareing variables
| From: | CrossWalkCentral | Date: | Sat, 18 May 2002 01:40:32 +0000 |
| Subject: | Re: compareing variables | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-19245@lists.php.net to get a copy of this message | ||
Thanks I took you up on option b and it worked great.
Thanks again.
"Hugh Bothwell" <hugh_bothwell@hotmail.com> wrote in message
news:20020518001008.66032.qmail@pb1.pair.com...
>
> "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...
> }
>
>