选择语言 :

 Core_UTF8::ucfirst

Makes a UTF-8 string's first character uppercase. This is a UTF8-aware version of ucfirst.

$str = UTF8::ucfirst($str);

string Core_UTF8::ucfirst( string $str )
author
Harry Fuecks hfuecks@gmail.com

参数列表

参数 类型 描述 默认值
$str string Mixed case string
返回值
  • string
File: ./core/classes/utf8.class.php
public static function ucfirst($str)
{
    if (UTF8::is_ascii($str))return ucfirst($str);

    preg_match('/^(.?)(.*)$/us', $str, $matches);
    return UTF8::strtoupper($matches[1]) . $matches[2];
}