No cache version.

Caching disabled. Default setting for this page:enabled (code LNG204)
If the display is too slow, you can disable the user mode to view the cached version.

Rechercher une fonction PHP

IntlChar::getPropertyValueEnum

(PHP 7)

IntlChar::getPropertyValueEnumGet the property value for a given value name

Description

public static IntlChar::getPropertyValueEnum ( int $property , string $name ) : int

Returns the property value integer for a given value name, as specified in the Unicode database file PropertyValueAliases.txt. Short, long, and any other variants are recognized.

Note:

Some of the names in PropertyValueAliases.txt will only be recognized with IntlChar::PROPERTY_GENERAL_CATEGORY_MASK, not IntlChar::PROPERTY_GENERAL_CATEGORY. These include:

  • "C" / "Other"
  • "L" / "Letter"
  • "LC" / "Cased_Letter"
  • "M" / "Mark"
  • "N" / "Number"
  • "P" / "Punctuation"
  • "S" / "Symbol"
  • "Z" / "Separator"

PHP: IntlChar::getPropertyValueEnum - Manual Home of Manuel PHP  Contents Haut

Parameters

property

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

If out of range, or this method doesn't work with the given value, IntlChar::PROPERTY_INVALID_CODE is returned.

name

The value name to be matched. The name is compared using "loose matching" as described in PropertyValueAliases.txt.

PHP: IntlChar::getPropertyValueEnum - Manual Home of Manuel PHP  Contents Haut

Return Values

Returns the corresponding value integer, or IntlChar::PROPERTY_INVALID_CODE if the given name does not match any value of the given property, or if the property is invalid.

PHP: IntlChar::getPropertyValueEnum - Manual Home of Manuel PHP  Contents Haut

Examples

Example #1 Testing different properties

<?php
var_dump
(IntlChar::getPropertyValueEnum(IntlChar::PROPERTY_BLOCK'greek') === IntlChar::BLOCK_CODE_GREEK);
var_dump(IntlChar::getPropertyValueEnum(IntlChar::PROPERTY_BIDI_CLASS'RIGHT_TO_LEFT') === IntlChar::CHAR_DIRECTION_RIGHT_TO_LEFT);
var_dump(IntlChar::getPropertyValueEnum(IntlChar::PROPERTY_BIDI_CLASS'some made-up string') === IntlChar::PROPERTY_INVALID_CODE);
var_dump(IntlChar::getPropertyValueEnum(123456789'RIGHT_TO_LEFT') === IntlChar::PROPERTY_INVALID_CODE);
?>

The above example will output:

bool(true)
bool(true)
bool(true)
bool(true)
Find a PHP function
Error Infobrol

Can not display this page of the Infobrol website

Type of error (18-01)

Unknown format specifier "&"

Please try again in a few minutes…

Return to the home page




Steph