PHP | IntlChar getBidiPairedBracket() Function
The IntlChar::getBidiPairedBracket() function is an inbuilt function in PHP which is used to get the paired bracket character for a code point. This function mapped with paired bracket. If the character has no pair bracket then it return the character itself.
Syntax:
IntlChar::getBidiPairedBracket ( $codepoint )
Parameters: This function accepts single parameter $codepoint which is mandatory. The $codepoint value is an integer values or character, which is encoded as a UTF-8 string.
Return Value: This function returns the mapped paired bracket. If the character has no pair bracket then it return the character itself.
Below programs illustrate the IntlChar::getBidiPairedBracket() function in PHP:
Program 1:
<?php // PHP function to illustrate // the use of IntlChar::getBidiPairedBracket() // Input data is number type var_dump(IntlChar::getBidiPairedBracket(91)); // Input data is bracket character type var_dump(IntlChar::getBidiPairedBracket('[')); // Input data is bracket character type var_dump(IntlChar::getBidiPairedBracket('}')); // Input data is bracket character type var_dump(IntlChar::getBidiPairedBracket('"')); // Input data is string type var_dump(IntlChar::getBidiPairedBracket('ABC')); // Input data is character type var_dump(IntlChar::getBidiPairedBracket('A')); ?> |
int(93)
string(1) "]"
string(1) "{"
string(1) """
NULL
string(1) "A"
Program 2:
<?php // PHP code to illustrate the // IntlChar::getBidiPairedBracket() function // Declare an array $arr $arr = array("G", "{", "^", ")", "6", "{}", "))", "\t"); // Loop run for every array element foreach ($arr as $val){ // Check each element as code point data var_dump(IntlChar::getBidiPairedBracket($val)); } ?> |
string(1) "G"
string(1) "}"
string(1) "^"
string(1) "("
string(1) "6"
NULL
NULL
string(1) " "
Related Articles:
- PHP | IntlChar::totitle() Function
- PHP | IntlChar::iscntrl() Function
- PHP | IntlChar charType() Function
Reference: http://php.net/manual/en/intlchar.getbidipairedbracket.php
Recommended Posts:
- PHP | IntlChar::chr() Function
- PHP | IntlChar::ord() Function
- PHP | IntlChar::isIDStart() Function
- PHP | IntlChar enumCharNames() Function
- PHP | IntlChar enumCharTypes() Function
- PHP | IntlChar::isULowercase() Function
- PHP | IntlChar::isIDPart() Function
- PHP | IntlChar::isISOControl() Function
- PHP | IntlChar getIntPropertyMinValue() Function
- PHP | IntlChar toupper() Function
- PHP | IntlChar tolower() Function
- PHP | IntlChar isMirrored() Function
- PHP | IntlChar::charAge() Function
- PHP | IntlChar getIntPropertyMaxValue() Function
- PHP | IntlChar getPropertyValueName() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



