Tuesday, November 19, 2024
Google search engine
HomeLanguagesPHP | IntlChar getPropertyValueEnum() Function

PHP | IntlChar getPropertyValueEnum() Function

The IntlChar getPropertyValueEnum() function is an inbuilt function in PHP which is used to get the property value form the given value.

Syntax:

int IntlChar::getPropertyValueEnum( $property, $nameĀ )

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

  • $property: It stores the IntlChar::PROPERTY_* constants.
  • $name: It stores the name value which to be stored.

Return Value: If the given name does not match to any property or the property is invalid then it returns the corresponding value integer, or IntlChar::PROPERTY_INVALID_CODE.

Below programs illustrate the IntlChar::getPropertyValueEnum() function in PHP:

Program:




<?php
// PHP program to implement IntlChar::getPropertyValueEnum() function
Ā Ā 
// Unicode property constant and it corresponding name is same
var_dump(IntlChar::getPropertyValueEnum(IntlChar::PROPERTY_BIDI_CLASS,
Ā Ā Ā Ā Ā Ā Ā Ā 'RIGHT_TO_LEFT') === IntlChar::CHAR_DIRECTION_RIGHT_TO_LEFT);
Ā Ā 
// Unicode property constant and it corresponding name is same
var_dump(IntlChar::getPropertyValueEnum(IntlChar::PROPERTY_BLOCK,
Ā Ā Ā Ā Ā Ā Ā Ā 'greek') === IntlChar::BLOCK_CODE_GREEK);
Ā Ā 
// Unicode property constant and it name is corresponding name is same
var_dump(IntlChar::getPropertyValueEnum(IntlChar::PROPERTY_BIDI_CLASS,
Ā Ā Ā Ā Ā Ā Ā Ā 'some made-up string') === IntlChar::PROPERTY_INVALID_CODE);
Ā Ā 
Ā Ā 
// Unicode property constant and it name is not matching so it return false
var_dump(IntlChar::getPropertyValueEnum(IntlChar::PROPERTY_BIDI_CLASS,
Ā Ā Ā Ā Ā Ā Ā Ā 'RIGHT_TO_LEFT') === IntlChar::BLOCK_CODE_GREEK);
Ā Ā 
?>


Output:

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

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

Whether youā€™re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions weā€™ve already empowered, and weā€™re here to do the same for you. Donā€™t miss out ā€“ check it out now!

RELATED ARTICLES

Most Popular

Recent Comments

ź°•ģ„œźµ¬ģ¶œģž„ė§ˆģ‚¬ģ§€ on How to store XML data into a MySQL database using Python?
źøˆģ²œźµ¬ģ¶œģž„ė§ˆģ‚¬ģ§€ on How to store XML data into a MySQL database using Python?
ź“‘ėŖ…ģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ź“‘ėŖ…ģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ė¶€ģ²œģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
źµ¬ģ›”ė™ģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ź°•ģ„œźµ¬ģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ģ˜¤ģ‚°ģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ź“‘ėŖ…ģ¶œģž„ė§ˆģ‚¬ģ§€ on How to store XML data into a MySQL database using Python?
ģ•ˆģ–‘ģ¶œģž„ė§ˆģ‚¬ģ§€ on How to store XML data into a MySQL database using Python?
ė¶€ģ²œģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ė™ķƒ„ģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ģ„œģšøģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ė¶„ė‹¹ģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ė¶€ģ²œģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ķ™”ź³”ė™ģ¶œģž„ė§ˆģ‚¬ģ§€ on How to store XML data into a MySQL database using Python?
ź°•ģ„œźµ¬ģ¶œģž„ė§ˆģ‚¬ģ§€ on How to store XML data into a MySQL database using Python?
ź³ ģ–‘ģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ķ™”ģ„±ģ¶œģž„ė§ˆģ‚¬ģ§€ on How to store XML data into a MySQL database using Python?
ģ²œķ˜øė™ģ¶œģž„ė§ˆģ‚¬ģ§€ on How to store XML data into a MySQL database using Python?