IntlChar::isprint
(PHP 7)
IntlChar::isprint — Check if code point is a printable character
説明
public static IntlChar::isprint
( mixed $codepoint
) : bool
Determines whether the specified code point is a printable character.
true
for general categories other than "C" (controls).
パラメータ
codepoint
- コードポイントを表す int 型の値 (例: U+2603 SNOWMAN を表す
0x2603
)、あるいは UTF-8 文字列としてエンコードされた文字 (例:"\u{2603}"
)。
返り値
Returns true
if
codepoint
is a printable character, false
if not.
例
例1 さまざまなコードポイントの例
<?phpvar_dump(IntlChar::isprint("A"));var_dump(IntlChar::isprint(" "));var_dump(IntlChar::isprint("\n"));var_dump(IntlChar::isprint("\u{200e}"));?>
上の例の出力は以下となります。
bool(true) bool(true) bool(false) bool(false)
参考
- IntlChar::iscntrl() - Check if code point is a control character
IntlChar::PROPERTY_DEFAULT_IGNORABLE_CODE_POINT