note 94171 added to function.ctype-upper
| From: | maran dot emil at gmail dot com | Date: | Tue, 20 Oct 2009 18:42:23 +0000 |
| Subject: | note 94171 added to function.ctype-upper | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-161918@lists.php.net to get a copy of this message | ||
<?php
/**
* Detect First Letter if is Uppercase
*
* @author Maran Emil | Maran Project | maran.emil@gmail.com
* @web http://maran.pamil-visions.com
*/
$arLetters =
array("A","B","C","D","E","F");
$text = "This Function is for detecting Big Letters";
function DetectBigLettersVersionOne($text){
global $arLetters;
$arTmpWords = explode(" ",$text);
foreach($arTmpWords as $singleWord){
$firstLetter = substr($singleWord,0,1);
if(in_array($firstLetter,$arLetters)){
echo "found...".substr($singleWord,0,1)."<br>";
}
}
}
function DetectBigLettersVersionTwo($text){
$arTmpWords = explode(" ",$text);
foreach($arTmpWords as $singleWord){
$firstLetter = substr($singleWord,0,1);
if((ord($firstLetter)> 65) && (ord()($firstLetter) < 90)){
echo "found...".substr($singleWord,0,1)."<br>";
}
}
}
DetectBigLettersVersionOne($text);
DetectBigLettersVersionTwo($text);
?>
----
Server IP: 64.71.164.2
Probable Submitter: 85.180.33.24
----
Manual Page -- http://www.php.net/manual/en/function.ctype-upper.php
Edit -- https://master.php.net/note/edit/94171
Del: integrated -- https://master.php.net/note/delete/94171/integrated
Del: useless -- https://master.php.net/note/delete/94171/useless
Del: bad code -- https://master.php.net/note/delete/94171/bad+code
Del: spam -- https://master.php.net/note/delete/94171/spam
Del: non-english -- https://master.php.net/note/delete/94171/non-english
Del: in docs -- https://master.php.net/note/delete/94171/in+docs
Del: other reasons-- https://master.php.net/note/delete/94171
Reject -- https://master.php.net/note/reject/94171
Search -- https://master.php.net/manage/user-notes.php