IntlChar::isgraph

(PHP 7)

IntlChar::isgraphCheck if code point is a graphic character

Descrierea

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

Determines whether the specified code point is a "graphic" character (printable, excluding spaces).

TRUE for all characters except those with general categories "Cc" (control codes), "Cf" (format controls), "Cs" (surrogates), "Cn" (unassigned), and "Z" (separators).

Parametri

codepoint

Valoarea codepoint de tip integer (de ex. 0x2603 pentru U+2603 SNOWMAN) sau caracterul codificat ca string în UTF-8 (de ex. "\u{2603}")

Valorile întoarse

Returns TRUE if codepoint is a "graphic" character, FALSE if not.

Exemple

Example #1 Testarea diferitor code points

<?php
var_dump
(IntlChar::isgraph("A"));
var_dump(IntlChar::isgraph("1"));
var_dump(IntlChar::isgraph("\u{2603}"));
var_dump(IntlChar::isgraph("\n"));
?>

Exemplul de mai sus va afișa:

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