IntlChar
PHP Manual

IntlChar::isWhitespace

(PHP 7)

IntlChar::isWhitespaceCheck if code point is a whitespace character according to ICU

Description

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

Determines if the specified code point is a whitespace character according to ICU.

A character is considered to be a ICU whitespace character if and only if it satisfies one of the following criteria:

Liste de paramètres

codepoint

La valeur codepoint de type integer (i.e. 0x2603 pour U+2603 SNOWMAN), ou le caractère encodé en UTF-8 de type string (i.e. "\u{2603}")

Valeurs de retour

Returns TRUE if codepoint is a whitespace character according to ICU, FALSE if not.

Exemples

Exemple #1 Test de différents codepoint

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

L'exemple ci-dessus va afficher :

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

Voir aussi


IntlChar
PHP Manual