[PHP-DB] Re: compareing variables

2002-05-17 Thread CrossWalkCentral

Thanks I took you up on option b and it worked great.

Thanks again.

"Hugh Bothwell" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> "Crosswalkcentral" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > 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...
> }
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: compareing variables

2002-05-17 Thread Hugh Bothwell


"Crosswalkcentral" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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...
}



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php