IntlChar::isspace
(PHP 7)
IntlChar::isspace — Check if code point is a space character
説明
public static IntlChar::isspace
( mixed $codepoint
) : bool
Determines if the specified character is a space character or not.
パラメータ
codepoint
- コードポイントを表す int 型の値 (例: U+2603 SNOWMAN を表す
0x2603
)、あるいは UTF-8 文字列としてエンコードされた文字 (例:"\u{2603}"
)。
返り値
Returns true
if
codepoint
is a space character, false
if not.
例
例1 さまざまなコードポイントの例
<?phpvar_dump(IntlChar::isspace("A"));var_dump(IntlChar::isspace(" "));var_dump(IntlChar::isspace("\n"));var_dump(IntlChar::isspace("\t"));var_dump(IntlChar::isspace("\u{00A0}"));?>
上の例の出力は以下となります。
bool(false) bool(true) bool(true) bool(true) bool(true)
参考
- IntlChar::isJavaSpaceChar() - Check if code point is a space character according to Java
- IntlChar::isWhitespace() - Check if code point is a whitespace character according to ICU
- IntlChar::isUWhiteSpace() - Check if code point has the White_Space Unicode property