PHP | IntlChar::isblank() Function
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 code to illustrate the // IntlChar::isblank() function. // input alphabe character var_dump(IntlChar::isblank("X")); // Plus operator var_dump(IntlChar::isblank("+")); // Space character var_dump(IntlChar::isblank(" ")); // % sign operator var_dump(IntlChar::isblank("%")); // tab character var_dump(IntlChar::isblank("\t")); // new line character var_dump(IntlChar::isblank("\n")); ?> |
Output:
bool(false) bool(false) bool(true) bool(false) bool(true) bool(false)
Program 2:
<?php // PHP code to illustrate the // IntlChar::isblank() function. // input alphabe character var_dump(IntlChar::isblank('X')); // Plus operator var_dump(IntlChar::isblank('+')); // Space character var_dump(IntlChar::isblank(' ')); // % sign operator var_dump(IntlChar::isblank('%')); // tab character var_dump(IntlChar::isblank('\t')); // new line character 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 code to illustrate the // IntlChar::isblank() function. // In case of input string var_dump(IntlChar::isblank("GeeksforGeeks is Computer Portal")); // In case of number input var_dump(IntlChar::isblank("2018")); ?> |
Output:
NULL NULL
Reference: http://php.net/manual/en/intlchar.isblank.php
Recommended Posts:
- How to call a function that return another function in JavaScript ?
- How to get the function name from within that function using JavaScript ?
- How to get the function name inside a function in PHP ?
- PHP | Ds\Set xor() Function
- PHP | pi( ) Function
- PHP | pow( ) Function
- PHP | each() Function
- D3.js | d3.max() function
- PHP | Ds\Map put() Function
- PHP | Ds\Map xor() Function
- PHP Ds\Set sum() Function
- D3.js | d3.min() function
- PHP Ds\Set get() Function
- CSS | rgb() Function
- PHP | key() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : Akanksha_Rai



