Skip to content

Instantly share code, notes, and snippets.

@gartes
Last active August 18, 2018 01:38
Show Gist options
  • Save gartes/fa3921c7e85bcd5893d3709a37338ad0 to your computer and use it in GitHub Desktop.
Save gartes/fa3921c7e85bcd5893d3709a37338ad0 to your computer and use it in GitHub Desktop.
Первый символ в верхний регистр
$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