Open In App

PHP | IntlChar getPropertyValueName() Function

The IntlChar::getPropertyValueName() function is an inbuilt function in PHP which is used to get the Unicode name for a property value. It will be according to the data present in PropertyValueAliases.txt, which is the Unicode DataBase file.

Syntax:



string IntlChar::getPropertyValueName( $property, $value, 
$nameChoice = IntlChar::LONG_PROPERTY_NAME )

Parameters: This function accepts three parameters as mentioned above and described below:

Return Values: If either the nameChoice or the property is totally out of the range then False will be returned. Otherwise, the name is going to be returned. If a nameChoice will be given, then it returns False. If False is returned for IntlChar::SHORT_PROPERTY_NAME, then IntlChar::LONG_PROPERTY_NAME (and higher) may still return a non-False value.



Program:




<?php
  
// PHP program to uses IntlChar::getPropertyValueName()
// function
  
var_dump(IntlChar::getPropertyValueName
   (IntlChar::PROPERTY_INT_START, IntlChar::BLOCK_CODE_TELUGU));
  
var_dump(IntlChar::getPropertyValueName
                (IntlChar::PROPERTY_GENERAL_CATEGORY, IntlChar::
     BLOCK_CODE_IPA_EXTENSIONS, IntlChar::SHORT_PROPERTY_NAME));
  
var_dump(IntlChar::getPropertyValueName
                      (IntlChar::PROPERTY_LINE_BREAK, IntlChar::
            BLOCK_CODE_DINGBATS, IntlChar::LONG_PROPERTY_NAME));
  
var_dump(IntlChar::getPropertyValueName
                    (IntlChar::PROPERTY_BINARY_LIMIT, IntlChar::
           BLOCK_CODE_BAMUM, IntlChar::LONG_PROPERTY_NAME + 1));
  
?>

Output:

string(21) "Right_To_Left_Isolate"
string(2) "Lo"
bool(false)
bool(false)

Reference: https://www.php.net/manual/en/intlchar.getpropertyvaluename.php

Article Tags :