Provides a simple example of PHP to determine the case letter function Oh, it can find out how many uppercase letters a string has how many lowercase letter oh, is a very convenient common function.
Provides a simple example of PHP tutorial to determine the case letter function Oh, it can find out how many uppercase letters a string has how many lowercase letter oh, is a very convenient common function.
function Checkcase ($str) {
if (Preg_match ('/^[a-z]+$/', $str)) {
echo ' Small Letter ';
}elseif (Preg_match ('/^[a-z]+$/', $str)) {
echo ' capital letters ';
}
}
Method Two
$str = ' a ';
function Checkcase1 ($STR) {
$str = Ord ($STR);
if ($str >64&& $str <91) {
echo ' capital letters ';
Return
}
if ($str >96&& $str <123) {
echo ' Small Letter ';
Return
}
Echo ' is not a letter ';
}
function Checkcase2 ($STR) {
if (Strtoupper ($str) = = = $str) {
echo ' capital letters ';
}else{
echo ' Small Letter ';
}
}
echo checkcase1 ($STR);
echo Checkcase2 ($STR);
?>
http://www.bkjia.com/PHPjc/445425.html www.bkjia.com true http://www.bkjia.com/PHPjc/445425.html techarticle provides a simple example of PHP to determine the case letter function Oh, it can find out how many uppercase letters a string has how many lowercase letter oh, is a very convenient common function. To mention ...