PHP 中的 ctype_upper()函数

首页 / PHP入门教程 / PHP 中的 ctype_upper()函数

ctype_upper() - 语法

ctype_upper ( $text );

此函数检查提供的字符串text中的所有字符是否都是大写字符。

Sr.No Parameter & Description
1

text(必需)

链接:https://www.learnfk.comhttps://www.learnfk.com/php/php-function-ctype-upper.html

来源:LearnFk无涯教程网

匹配字符串。

ctype_upper() - 返回值

如果文本中的每个字符都是当前区域设置中的大写字母,则返回true。

ctype_upper() - 示例

<?php
   $strings=array('test12345', 'ABCEFG');
   
   foreach ($strings as $test) {
      if (ctype_upper($test)) {
         echo "$test consists of all uppercase letters.\n";
      }else {
         echo "$test does not have all uppercase letters.\n";
      }
   }
?> 

这将产生以下输出-

test12345 does not have all uppercase letters.
ABCEFG consists of all uppercase letters.

祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)

技术教程推荐

技术领导力实战笔记 -〔TGO鲲鹏会〕

高并发系统设计40问 -〔唐扬〕

Spark性能调优实战 -〔吴磊〕

玩转Vue 3全家桶 -〔大圣〕

大厂设计进阶实战课 -〔小乔〕

超级访谈:对话玉伯 -〔玉伯〕

高并发系统实战课 -〔徐长龙〕

AI大模型之美 -〔徐文浩〕

AI大模型系统实战 -〔Tyler〕

好记忆不如烂笔头。留下您的足迹吧 :)