<?php
function mixedCases($text) {
if(preg_match("([A-Z])", $text))
$upperCaseChars = true;
else
$upperCaseChars = false;
if(preg_match("([a-z])", $text))
$lowerCaseChars = true;
else
$lowerCaseChars = false;
if($upperCaseChars && $lowerCaseChars)
return true;
else
return false;
}
$mixed = "ABCz";
if(mixedCases($mixed))
echo "Mixed Cases in \"$mixed\"";
else
echo "NOT Mixed Cases in \"$mixed\"";
?>