Re: [PHP] Upper or Lower Case

2001-08-07 Thread Bjorn Van Simaeys
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 <[EMAIL PROTECTED]> wrote: > > On 07-Aug-2001 Bjorn Van Simaeys wrote: > > Hi, > > > > I have run a

Re: [PHP] Upper or Lower Case

2001-08-07 Thread Philip Olson
Also keep in mind that sometimes spaces find their ways into the string and using trim() will get rid of them. Something like : if (strcasecmp('neo',trim($name)) == 0) { echo 'You chose our Neo line of goods, way to go!'; } Not to say spaces randomly attach to strings :-) but to be saf

Re: [PHP] Upper or Lower Case

2001-08-07 Thread Don Read
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)) //

RE: [PHP] Upper or Lower Case

2001-08-07 Thread Jon Farmer
>What happens if they type "NeO", or "NEO", or "nEo", or "neO" (etc)? ;) >Also, if you're using this in a large application (or intend to in the >future), are you going to type out all of the names as you have done with >the neo example? >Bjorn's method is much better, and you're better off gettin

Re: [PHP] Upper or Lower Case

2001-08-07 Thread James Holloway
== "neo" || $name == "Neo") > > > -Original Message- > From: Bjorn Van Simaeys [mailto:[EMAIL PROTECTED]] > Sent: 07 August 2001 16:24 > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Upper or Lower Case > > > Hi, > > I have run accr

RE: [PHP] Upper or Lower Case

2001-08-07 Thread Tarrant Costelloe
Ok thanks, I found jons way the easiest: if ($name == "neo" || $name == "Neo") -Original Message- From: Bjorn Van Simaeys [mailto:[EMAIL PROTECTED]] Sent: 07 August 2001 16:24 To: [EMAIL PROTECTED] Subject: Re: [PHP] Upper or Lower Case Hi, I have run accross t

Re: [PHP] Upper or Lower Case

2001-08-07 Thread Bjorn Van Simaeys
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. Greetz, Bjorn Van Simaeys www.bvsenterprises.com --- Tarrant Costelloe <[EMAIL PROTECTED]> wrote: > W

[PHP] Upper or Lower Case

2001-08-07 Thread Tarrant Costelloe
When doing the following if statement: if ($name == "neo") How can you specify that it doesn't matter whether the first letter of "Neo" is in captials or not. Thanks! Taz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mai