[PHP] Upper and lower case.

2003-03-01 Thread Philip J. Newman
Question: is it better to store user names as upper and lower case? should they bee converted to one case? I have a script the checks for names and ... Mark is not the same as mark, or MaRk ... is there a way of making a string into lower case? -- Philip J. Newman. Head Developer [EMAIL

Re: [PHP] Upper and lower case.

2003-03-01 Thread Philip J. Newman
LOL got a reply to this before i ever got the message my self ... - Original Message - From: Philip J. Newman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 02, 2003 10:56 AM Subject: [PHP] Upper and lower case. Question: is it better to store user names as upper

RE: [PHP] Upper and lower case.

2003-03-01 Thread John W. Holmes
is it better to store user names as upper and lower case? should they bee converted to one case? Store it where? It depends if the place you store it in and the comparisons there are going to be case sensitive or not. Most database fields are going to be case sensitive while a PHP comparison

Re: [PHP] Upper or Lower Case

2001-08-07 Thread James Holloway
]] Sent: 07 August 2001 16:24 To: [EMAIL PROTECTED] Subject: Re: [PHP] Upper or Lower Case 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.

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 getting into good

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)) // why

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

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 accross