The IntlChar::isspace() function check whether the given input character is a space character or not.
Syntax
IntlChar::isspace(val)
Parameters
val − An integer value or character encoded as UTF-8 string.
Return
The IntlChar::isspace()function returnsTRUE if the val is a space character.
Example
The following is an example −
<?php
var_dump(IntlChar::isspace("abcd"));
echo "<br>";
var_dump(IntlChar::isspace("n"));
echo "<br>";
var_dump(IntlChar::isspace("r"));
?>Output
The following is the output −
NULL bool(true) bool(true)
Example
Let us see another example −
<?php
var_dump(IntlChar::isspace("787"));
echo "<br>";
var_dump(IntlChar::isspace(" "));
echo "<br>";
var_dump(IntlChar::isspace("*"));
?>Output
The following is the output −
NULL bool(true) bool(false)