Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
IntlChar::islower() function in PHP
The IntlChar::islower() function checks whether the given input character is a lowercase character or not.
Syntax
bool IntlChar::islower(val)
Parameters
val − A character encoded as a UTF-8 string or an integer codepoint value.
Return Value
The IntlChar::islower() function returns TRUE if the entered value is a lowercase character, FALSE otherwise.
Example
The following example demonstrates how to check if characters are lowercase −
<?php
var_dump(IntlChar::islower("a"));
echo "<br>";
var_dump(IntlChar::islower("A"));
echo "<br>";
var_dump(IntlChar::islower("z"));
echo "<br>";
var_dump(IntlChar::islower("1"));
echo "<br>";
var_dump(IntlChar::islower("@"));
?>
The output of the above code is −
bool(true) bool(false) bool(true) bool(false) bool(false)
Using Unicode Codepoints
You can also pass Unicode codepoint values as integers −
<?php
// Codepoint for 'a' is 97
var_dump(IntlChar::islower(97));
echo "<br>";
// Codepoint for 'A' is 65
var_dump(IntlChar::islower(65));
?>
The output of the above code is −
bool(true) bool(false)
Conclusion
The IntlChar::islower() function is useful for validating lowercase characters in internationalization contexts. It accepts both string characters and Unicode codepoint integers as input.
Advertisements
