Last active
August 18, 2018 01:38
-
-
Save gartes/fa3921c7e85bcd5893d3709a37338ad0 to your computer and use it in GitHub Desktop.
Первый символ в верхний регистр
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$str = ucfirst( $str ) ; | |
// ============ | |
/** | |
* Для керилицы | |
*/ | |
static function mb_ucasefirst($str) | |
{ | |
$str[0] = mb_strtoupper($str[0]); | |
return $str; | |
}#END FUNCTION | |
// ============ | |
function ucfirst_utf8($stri) | |
{ | |
if($stri{0}>="\xc3") | |
return (($stri{1}>="\xa0")? | |
($stri{0}.chr(ord($stri{1})-32)): | |
($stri{0}.$stri{1})).substr($stri,2); | |
else return ucfirst($stri); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment