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::isblank() function in PHP
The IntlChar::isblank() function checks whether the entered value is a blank or horizontal space character. This function is part of PHP's Internationalization extension and follows Unicode standards for character classification.
Syntax
IntlChar::isblank(val)
Parameters
val − An integer or character encoded as a UTF-8 string representing a Unicode code point.
Return Value
The IntlChar::isblank() function returns TRUE if the entered value is a blank or horizontal space character, FALSE otherwise. Returns NULL on failure.
Example
The following example demonstrates how to use IntlChar::isblank() with different characters ?
<?php
var_dump(IntlChar::isblank(" ")); // Space character
echo "<br>";
var_dump(IntlChar::isblank("\t")); // Tab character
echo "<br>";
var_dump(IntlChar::isblank("A")); // Letter
echo "<br>";
var_dump(IntlChar::isblank("8")); // Digit
echo "<br>";
var_dump(IntlChar::isblank("<br>")); // Newline (not blank)
?>
Output
The output of the above code is ?
bool(true) bool(true) bool(false) bool(false) bool(false)
Key Points
Blank characters include space (U+0020) and horizontal tab (U+0009)
Newline characters are not considered blank characters
The function follows Unicode character properties for classification
Conclusion
The IntlChar::isblank() function is useful for validating horizontal whitespace characters in Unicode text processing. It specifically identifies space and tab characters while excluding other whitespace like newlines.
