Re: Upper or Lower Case

From: Date: Tue, 07 Aug 2001 18:01:26 +0000
Subject: Re: Upper or Lower Case
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-61674@lists.php.net to get a copy of this message
I must agree with Don that strcasecmp is the best way to go. Combined with the 'trim' function this is completely foolproof. Thanks, Don! Bjorn Van Simaeys www.bvsenterprises.com --- Don Read <dread@texas.net> wrote: > > On 07-Aug-2001 Bjorn Van Simaeys wrote: > > Hi, > > > > I have run accross this problem too, and I solve > it > > this way: > > > > if(strtolower($name1) == strtolower($name2)) > > > > I compare both variables in lower case, this way > > capitals don't matter at all. > > > > > > if (0 == strcasecmp('neo', $name)) // why didn't > the call this stricmp ? > echo 'matched'; > > if eregi('^neo$', $name) > echo 'matched also'; > > Regards, > -- > Don Read > dread@texas.net > -- It's always darkest before the dawn. So if you > are going to > steal the neighbor's newspaper, that's the time > to do it. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > php-general-unsubscribe@lists.php.net > For additional commands, e-mail: > php-general-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/

« previous php.general (#61674) next »