- mb_substr: documentation ( source)
- mb_strtolower: documentation ( source)
<?php
function starts_with_upper($str) {
$chr = mb_substr ($str, 0, 1, "UTF-8");
return mb_strtolower($chr, "UTF-8") != $chr;
}
print("STARTS WITH 'a': Hello " . starts_with_upper('Hello') . "\n\n");
print("STARTS WITH 'a': hello " . starts_with_upper('hello') . "\n\n");