Grw::utf8_strlen PHP Method

utf8_strlen() public method

字符长度计算
public utf8_strlen ( null $string = NULL ) : integer
$string null
return integer
    function utf8_strlen($string = NULL)
    {
        // 将字符串分解为单元
        preg_match_all("/./us", $string, $match);
        // 返回单元个数
        return count($match[0]);
    }