IntlChar
PHP Manual

IntlChar::isJavaSpaceChar

(PHP 7)

IntlChar::isJavaSpaceCharCheck if code point is a space character according to Java

Descrição

public static bool IntlChar::isJavaSpaceChar ( mixed $codepoint )

Determine if the specified code point is a space character according to Java.

TRUE for characters with general categories "Z" (separators), which does not include control codes (e.g., TAB or Line Feed).

Parâmetros

codepoint

Um codepoint integer (por exemplo 0x2603 para U+2603 SNOWMAN), ou um caracter codificado como uma string UTF-8 (exemplo "\u{2603}")

Valor Retornado

Returns TRUE if codepoint is a space character according to Java, FALSE if not.

Exemplos

Exemplo #1 Testando codepoints diferentes

<?php
var_dump
(IntlChar::isJavaSpaceChar("A"));
var_dump(IntlChar::isJavaSpaceChar(" "));
var_dump(IntlChar::isJavaSpaceChar("\n"));
var_dump(IntlChar::isJavaSpaceChar("\t"));
var_dump(IntlChar::isJavaSpaceChar("\u{00A0}"));
?>

O exemplo acima irá imprimir:

bool(false)
bool(true)
bool(false)
bool(false)
bool(true)

Veja Também


IntlChar
PHP Manual