牛牛在线工具

IntlChar::isupper()

收录 8868 个 PHP 函数,含用途说明与用法示例。

IntlChar::isupper()

判断给定的 Unicode 字符是否为大写字母

函数名称:IntlChar::isupper() 适用版本:PHP 7.0.0 及以上版本 函数描述:IntlChar::isupper() 函数用于判断给定的 Unicode 字符是否为大写字母。 用法: bool IntlChar::isupper( mixed $codepoint ) 参数: $codepoint:要判断的 Unicode 字符的代码点(可以是整数、字符或字符串形式)。 返回值: 如果给定的字符是大写字母,则返回 true。 如果给定的字符不是大写字母,则返回 false。 示例: // 判断字符 'A' 是否为大写字母 var_dump(IntlChar::isupper('A')); // 输出: bool(true) // 判断字符 'a' 是否为大写字母 var_dump(IntlChar::isupper('a')); // 输出: bool(false) // 判断字符 'Z' 是否为大写字母 var_dump(IntlChar::isupper('Z')); // 输出: bool(true) // 判断字符 'z' 是否为大写字母 var_dump(IntlChar::isupper('z')); // 输出: bool(false) // 判断字符 '1' 是否为大写字母 var_dump(IntlChar::isupper('1')); // 输出: bool(false) // 判断字符 '!' 是否为大写字母 var_dump(IntlChar::isupper('!')); // 输出: bool(false) // 判断字符 '中' 是否为大写字母 var_dump(IntlChar::isupper('中')); // 输出: bool(false) // 判断字符 'A' 的 Unicode 代码点 65 是否为大写字母 var_dump(IntlChar::isupper(65)); // 输出: bool(true) 注意事项: 该函数只能判断单个字符是否为大写字母,对于多字符的字符串无效。 如果给定的字符不是有效的 Unicode 字符,该函数会返回 false。