The IntlChar::isWhitespace() function checks whether the given input character is a WhiteSpace character or not.
Syntax
IntlChar::isWhitespace(val)
Parameters
val − A character or integer value encoded as a UTF-8 string.
Return
The IntlChar::isWhitespace()function returns TRUE if val is a WhiteSpace character.
Example
The following is an example −
<?php var_dump(IntlChar::iswhitespace("M")); echo "<br>"; var_dump(IntlChar::iswhitespace(" ")); echo "<br>"; var_dump(IntlChar::iswhitespace("& ")); echo "<br>"; ?>
Output
The following is the output −
bool(false) bool(true) NULL