这个 IntlChar::islower() 函数是PHP中的一个内置函数,用于检查给定的输入字符是否为小写字符。
null
语法:
bool IntlChar::islower( $codepoint )
参数: 此函数只接受一个参数 $codepoint 这是强制性的。输入参数是一个字符,编码为UTF-8字符串。
返回值: 如果 $codepoint 是小写字符,则返回True,否则返回False。
下面的程序说明了 IntlChar::islower() PHP中的函数:
项目1:
PHP
<?php // PHP code to illustrate IntlChar::islower() // function // Input data is character type var_dump(IntlChar::islower( "a" )); var_dump(IntlChar::islower( "A" )); var_dump(IntlChar::islower( "u{0041}" )); // Input data is control character var_dump(IntlChar::islower( " " )); // Input data is string type var_dump(IntlChar::islower( "Geeksforgeeks" )); // Input data is number type var_dump(IntlChar::islower( "2018" )); // Input data is single digit var_dump(IntlChar::islower( "5" )); ?> |
输出:
bool(true) bool(false) bool(false) bool(false) NULL NULL bool(false)
注: 如果字符串和数字(除了一位数)用作参数,则返回NULL。
项目2:
PHP
<?php // PHP code to illustrate IntlChar::islower() // Declare an array $arr $arr = array ( "a" , "u{FF41}" , "A" , "u{0041}" , "0" , "" , "123" , "Geeks" ); // u{0041} is ASCII value of 'A' // u{FF41} is ASCII value of 'a' // Loop run for every array element foreach ( $arr as $val ){ // Check each element as code point data var_dump(IntlChar::islower( $val )); } ?> |
输出:
bool(true) bool(true) bool(false) bool(false) bool(false) bool(false) NULL NULL
相关文章:
- PHP | IntlChar::isupper()函数
- PHP | IntlChar::isdigit()函数
- PHP | IntlChar::isalnum()函数
- PHP | IntlChar::isalpha()函数
参考: http://php.net/manual/en/intlchar.islower.php
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END