$username ="你好"; $pattern = ‘/^[\x{4e00}-\x{9fa5}]{2,20}$/u‘; $res = preg_match($pattern,$username); var_dump($res);
时间: 2024-12-21 16:14:23
$username ="你好"; $pattern = ‘/^[\x{4e00}-\x{9fa5}]{2,20}$/u‘; $res = preg_match($pattern,$username); var_dump($res);