PHP 8.5.0 Alpha 2 available for testing

IntlChar::hasBinaryProperty

(PHP 7, PHP 8)

IntlChar::hasBinaryPropertyVerifica una propiedad Unicode binaria para un punto de código

Descripción

public static IntlChar::hasBinaryProperty(int|string $codepoint, int $property): ?bool

Verifica una propiedad Unicode binaria para un punto de código.

Unicode, en particular en la versión 3.2, define muchas más propiedades que el conjunto original en UnicodeData.txt.

Las API de propiedades están destinadas a reflejar las propiedades Unicode tal como se definen en la base de datos de caracteres Unicode (UCD) y los informes técnicos Unicode (UTR). Para más detalles sobre las propiedades, ver » http://www.unicode.org/ucd/. Para los nombres de las propiedades Unicode, ver el archivo UCD PropertyAliases.txt.

Parámetros

codepoint

The int codepoint value (e.g. 0x2603 for U+2603 SNOWMAN), or the character encoded as a UTF-8 string (e.g. "\u{2603}")

property

The Unicode property to lookup (see the IntlChar::PROPERTY_* constants).

Valores devueltos

Devuelve true o false según el valor de la propiedad Unicode binaria para codepoint. También devuelve false si property está fuera de alcance o si la versión Unicode no tiene datos para la propiedad en absoluto, o no para este punto de código. Devuelve null en caso de fallo.

Ejemplos

Ejemplo #1 Testing different properties

<?php
var_dump
(IntlChar::hasBinaryProperty("A", IntlChar::PROPERTY_ALPHABETIC));
var_dump(IntlChar::hasBinaryProperty("A", IntlChar::PROPERTY_CASE_SENSITIVE));
var_dump(IntlChar::hasBinaryProperty("A", IntlChar::PROPERTY_BIDI_MIRRORED));
var_dump(IntlChar::hasBinaryProperty("[", IntlChar::PROPERTY_ALPHABETIC));
var_dump(IntlChar::hasBinaryProperty("[", IntlChar::PROPERTY_CASE_SENSITIVE));
var_dump(IntlChar::hasBinaryProperty("[", IntlChar::PROPERTY_BIDI_MIRRORED));
?>

El ejemplo anterior mostrará :

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

Ver también

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top