PHP 检测是否汉语名字


/**
 * 检查名字
 * @param $name
 * @return bool
 */
private function is_chineseName($name)
{
    if (preg_match('/^([\xe4-\xe9][\x80-\xbf]{2}){2,4}$/', $name)) {
        return true;
    } else {
        return false;
    }
}

Leave A Comment

Please be polite. We appreciate that. Your email address will not be published and required fields are marked