(PHP 7, PHP 8)
IntlChar::iscntrl — Vérifie si un point de code est un caractère de contrôle
Détermine si le point de code spécifié est un caractère de contrôle.
Un caractère de contrôle est l'un des suivants:
IntlChar::CHAR_CATEGORY_CONTROL_CHAR (Cc)IntlChar::CHAR_CATEGORY_FORMAT_CHAR (Cf)IntlChar::CHAR_CATEGORY_LINE_SEPARATOR (Zl)IntlChar::CHAR_CATEGORY_PARAGRAPH_SEPARATOR (Zp)codepointLa valeur codepoint de type entier
(i.e. 0x2603 pour U+2603 SNOWMAN), ou le caractère encodé en UTF-8 de type chaîne de caractères
(i.e. "\u{2603}")
Renvoie true si
codepoint est un caractère de contrôle, false sinon. Renvoie null en cas d'échec.
Exemple #1 Test de différents codepoint
<?php
var_dump(IntlChar::iscntrl("A"));
var_dump(IntlChar::iscntrl(" "));
var_dump(IntlChar::iscntrl("\n"));
var_dump(IntlChar::iscntrl("\u{200e}"));
?>L'exemple ci-dessus va afficher :
bool(false) bool(false) bool(true) bool(true)
IntlChar::PROPERTY_DEFAULT_IGNORABLE_CODE_POINT