×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Сергей Шевченко
Added: Dec 1, 2016 8:00 PM
Modified: May 23, 2017 4:00 PM
Views: 12
Первая кириллическая буква в верхнем регистре
  1. function mb_ucfirst($str, $encoding='UTF-8')
  2. {
  3.     $str = mb_ereg_replace('^[\ ]+', '', $str);
  4.     $str = mb_strtoupper(mb_substr($str, 0, 1, $encoding), $encoding).
  5.         mb_substr($str, 1, mb_strlen($str), $encoding);
  6.     return $str;
  7. }