Re: Checking a strings case
| From: | dwalker | Date: | Tue, 15 Apr 2003 05:37:52 +0000 |
| Subject: | Re: Checking a strings case | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-143869@lists.php.net to get a copy of this message | ||
I think the difference between lower case and upper case (in terms of ascii
characters) is consistantly 32. That's to say to get from 'a' to 'A', you
have to add 32 to the ascii number representing 'a' to get 'A'. I'm not
sure how this translates binarily (or any other way), and to what extent
this brainstorm exercise helped you any.
What code did you use to solve the 'non-interlaced' use of caps and
lowercase text?
-----Original Message-----
From: ODCS <odcs@rogers.com>
To: PHP General <php-general@lists.php.net>
Date: Tuesday, April 15, 2003 12:54 AM
Subject: [PHP] Checking a strings case
>I'm trying to create a function to check a users input for "foul" language
>and want to be able to check variations of case (i.e. CasE or cAsE). I have
>checked out all the ereg and str* functions but not quite sure how to do
>this. These "foul" words are in an array. I have it working now if a user
>inputs 'case' or 'CASE'.
>
>TIA
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>