PHP 中的 ctype_lower()函数

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

ctype_lower() - 语法

ctype_lower ( $text );

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

Sr.No Parameter & Description
1

text(必需)

无涯教程网

匹配字符串。

ctype_lower() - 返回值

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

ctype_lower() - 示例

<?php
   $strings=array('aac123', 'testing', "testin IS Done");
   
   foreach ($strings as $test) {
      if (ctype_lower($test)) {
         echo "$test consists of all lowercase letters.\n";
      }else {
         echo "$test does not have all lowercase letters.\n";
      }
   }
?> 

这将产生以下输出-

aac123 does not have all lowercase letters.
testing consists of all lowercase letters.
testin IS Done does not have all lowercase letters.

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

技术教程推荐

人工智能基础课 -〔王天一〕

Go语言从入门到实战 -〔蔡超〕

编译原理之美 -〔宫文学〕

后端技术面试 38 讲 -〔李智慧〕

Vim 实用技巧必知必会 -〔吴咏炜〕

张汉东的Rust实战课 -〔张汉东〕

徐昊 · TDD项目实战70讲 -〔徐昊〕

计算机基础实战课 -〔彭东〕

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

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