The IntlChar::isblank() function is an inbuilt function in PHP which is used to determine the given input code data is blank or horizontal space character and the character visible separates words on a line.
If the input contains U+0009 (TAB) and characters “Zs” (space separators) except Zero Width Space (ZWSP, U+200B) then it will be True.
A Unicode White_Space character except “vertical space controls” character is true where vertical space controls contain following characters: U+000A (LF) U+000B (VT) U+000C (FF) U+000D (CR) U+0085 (NEL) U+2028 (LS) U+2029 (PS).
Syntax:
bool IntlChar::isblank ( $codepoint )
Parameter: This function accepts a single parameter as mentioned above and described below:
- $codepoint: The input parameter $codepoint is an integer values or character, which is encoded as a UTF-8 string. The function returns a boolean value after the compilation of function.
Return Value: If $codepoint is a blank space or horizontal space character then returns TRUE, otherwise returns FALSE. Examples:
Input : $codepoint = "G"
Output :bool(false)
// Character becomes False
Input : $codepoint = " "
Output : bool(true)
// Space becomes TRUE
Input : $codepoint = "Geeks"
Output : NULL
// String becomes NULL
Below programs illustrate the IntlChar::isblank() function in PHP:
Program 1:
php
<?php
var_dump(IntlChar::isblank("X"));
var_dump(IntlChar::isblank("+"));
var_dump(IntlChar::isblank(" "));
var_dump(IntlChar::isblank("%"));
var_dump(IntlChar::isblank("\t"));
var_dump(IntlChar::isblank("\n"));
?>
|
Output:
bool(false)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
Program 2:
php
<?php
var_dump(IntlChar::isblank( 'X' ));
var_dump(IntlChar::isblank( '+' ));
var_dump(IntlChar::isblank( ' ' ));
var_dump(IntlChar::isblank( '%' ));
var_dump(IntlChar::isblank( '\t' ));
var_dump(IntlChar::isblank( '\n' ));
?>
|
Output:
bool(false)
bool(false)
bool(true)
bool(false)
NULL
NULL
Program 3: If function input is string or number, then it will print NULL.
php
<?php
var_dump(IntlChar::isblank("GeeksforGeeks is Computer Portal"));
var_dump(IntlChar::isblank("2018"));
?>
|
Output:
NULL
NULL
Reference: http://php.net/manual/en/intlchar.isblank.php
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
28 Mar, 2023
Like Article
Save Article