I have texts in UTF-8 with diacritic characters also, and would like to check if first letter of this text is upper case or lower case. How to do this?
function starts_with_upper($str) { $chr = mb_substr ($str, 0, 1, "UTF-8"); return mb_strtolower($chr, "UTF-8") != $chr; }
Note that mb_substr is necessary to correctly isolate the first character.
2.1m questions
2.1m answers
60 comments
57.0k users