How to detect if string contains 1 uppercase letter in PHP
if (strtolower($url) != $url){
//etc...
Some regular expression should be able to the work, you can use preg_match
and [A-Z]
if(preg_match('/[A-Z]/', $domain)){
// There is at least one upper
}
You can also try this
if (!ctype_lower($string)) {
// there is at least une uppercase character
}
not sure if this is more efficient than the other two methods proposed.