Re: Compare Case Insensitive?
| From: | Ryan Gibson | Date: | Thu, 08 Apr 2004 15:26:58 +0000 |
| Subject: | Re: Compare Case Insensitive? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-182845@lists.php.net to get a copy of this message | ||
You could set your input string to upper case, then make all your
comparisons in upper case
http://www.php.net/manual/en/function.strtoupper.php
On 8/4/04 4:21 pm, "Jeff Oien" <jeff@webdesigns1.com> wrote:
> How can I compare a variable submitted by a form as case
> insensitive? A promotional code will be entered into a form
> and it's important that they can enter the code either way.
> So if I have
>
> if ($code == 'ABC123') {
>
> I want that to match 'aBC123' 'abc123' or whatever. Thanks.
> Jeff