note 55885 added to function.strtoupper
| From: | Indio at osu1 dot php dot net | Date: | Tue, 16 Aug 2005 16:13:10 +0000 |
| Subject: | note 55885 added to function.strtoupper | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-93752@lists.php.net to get a copy of this message | ||
Here is way to test a string for upper case characters (smaller footprint than previous post)
// test if a string or a single character in a string is uppercase
// if this returns false, then the "string" is lower case
function CheckCase($string,$location='-1') {
// if a location is passed in, check that character only.
// if not, or the passed in value is <0, check the whole
// string for uppercase characters.
if($location >= 0) {
return(strcmp(strtolower($string{$location}),$string{$location}));
}
else {
return(strcmp(strtolower($string),$string));
}
}
----
Manual Page -- http://www.php.net/manual/en/function.strtoupper.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55885
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55885&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55885&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55885&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55885&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55885&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55885&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55885&report=yes
Search -- http://master.php.net/manage/user-notes.php