PHP | IntlChar::isUWhiteSpace() Function
Last Updated :
31 Mar, 2023
The IntlChar::isUWhiteSpace() function is an inbuilt function in PHP which is used to check whether the given input character is a WhiteSpace Unicode character or not. IntlChar accesses a number utility function and used to access the information about Unicode Characters.
Syntax:
bool IntlChar::isUWhiteSpace( $codepoint )
Parameters: This function accepts a single parameter $codepoint which is mandatory. The input parameter is a character or integer value, which is encoded as a UTF-8 string.
Return Value: If $codepoint is WhiteSpace character then returns True, otherwise returns False.
Below programs illustrate the IntlChar::isUWhiteSpace() Function in PHP.
Program 1:
php
<?php
var_dump(IntlChar::isUWhiteSpace( "N" ));
var_dump(IntlChar::isUWhiteSpace( " n " ));
var_dump(IntlChar::isUWhiteSpace( "\n" ));
var_dump(IntlChar::isUWhiteSpace( "\u{00B0}" ));
?>
|
Output:
bool(false)
NULL
bool(true)
bool(false)
Program 2:
php
<?php
$arr = array ( "X\t" , "\n" , "^" , "\r" , "\t\r" );
foreach ( $arr as $val ){
var_dump(IntlChar::isUWhiteSpace( $val ));
}
?>
|
Output:
NULL
bool(true)
bool(false)
bool(true)
NULL
Related Articles:
Reference: http://php.net/manual/en/intlchar.isuwhitespace.php
Share your thoughts in the comments
Please Login to comment...