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.
More Related Contents:
- Using str_split on a UTF-8 encoded string
- Multi-byte safe wordwrap() function for UTF-8
- How to convert all characters to their html entity equivalent using PHP
- Reference: Why are my “special” Unicode characters encoded weird using json_encode?
- How can I get a hex dump of a string in PHP?
- PHP DOMDocument loadHTML not encoding UTF-8 correctly
- SET NAMES utf8 in MySQL?
- Remove new lines from string and replace with one empty space
- PHP, get file name without file extension
- URL Friendly Username in PHP?
- PHP: Split string [duplicate]
- Mixing a PHP variable with a string literal
- How to mimic Stack Overflow Auto-Link Behavior
- Remove control characters from PHP string
- Convert flat array to a delimited string to be saved in the database
- Split string by new line characters
- string sanitizer for filename
- PHP function to delete all between certain character(s) in string
- How do you pull first 100 characters of a string in PHP
- How to convert a string to JSON object in PHP
- Regex to detect invalid UTF-8 string
- Get the first letter of each word in a string
- PHP variable interpolation vs concatenation [duplicate]
- php header excel and utf-8
- json_encode() non utf-8 strings?
- UTF-8 encoding for subject in contact form email
- php substr() function with utf-8 leaves � marks at the end
- Close open HTML tags in a string
- php regex word boundary matching in utf-8
- Is a BLOB converted using the current/default charset in MySQL?