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
IntlChar::isUAlphabetic() function in PHP
The IntlChar::isUAlphabetic() function is used to check whether the entered value is an Alphabetic Unicode character or not. This function is part of PHP's Internationalization extension and follows Unicode standards for character classification.
Syntax
IntlChar::isUAlphabetic(val)
Parameters
val − A character or integer value encoded as a UTF-8 string, or an integer codepoint value.
Return Value
The IntlChar::isUAlphabetic() function returns TRUE if the value is an Alphabetic Unicode character, FALSE otherwise, or NULL on failure.
Example
The following example demonstrates checking various characters ?
<?php
var_dump(IntlChar::isUAlphabetic("7"));
echo "<br>";
var_dump(IntlChar::isUAlphabetic("Y"));
echo "<br>";
var_dump(IntlChar::isUAlphabetic("@"));
echo "<br>";
var_dump(IntlChar::isUAlphabetic("?")); // Greek alpha
echo "<br>";
var_dump(IntlChar::isUAlphabetic(65)); // ASCII code for 'A'
?>
Output
bool(false) bool(true) bool(false) bool(true) bool(true)
Key Points
- The function only works with single characters, not strings
- It supports Unicode alphabetic characters from various languages
- Integer codepoint values can also be passed as parameters
- Returns
NULLfor invalid input like multi-character strings
Conclusion
The IntlChar::isUAlphabetic() function provides Unicode-aware alphabetic character detection, making it useful for internationalized applications that need to validate characters from different writing systems.
