note 56940 added to function.strtoupper
| From: | Sean at osu1 dot php dot net | Date: | Tue, 20 Sep 2005 01:41:18 +0000 |
| Subject: | note 56940 added to function.strtoupper | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-95441@lists.php.net to get a copy of this message | ||
A quick, easy way to see if there are any caps; AND tell how many there are... you could easily do
this:
<?
$str="3 CAPS and the rest lowercase";
$howmany=preg_match_all("@[A-Z]@",$str,$m,PREG_OFFSET_CAPTURE);
?>
That would make $howmany become the integer 4; because there are 4 capitals in the string: $str.
("CAPS")
Hope this helps anyone.
~Sean
----
Manual Page -- http://www.php.net/manual/en/function.strtoupper.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56940
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56940&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56940&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56940&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56940&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56940&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+56940&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56940&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56940&report=yes
Search -- http://master.php.net/manage/user-notes.php