PHP IntlChar getBidiPairedBracket () function

PHP

Syntax:
IntlChar::getBidiPairedBracket ($codepoint)
Parameters:This function takes one parameter $codepoint, which is required. The $codepoint value is an integer value or a character that is encoded as a UTF-8 string.Returned value:this function returns the matched pair parenthesis. If the character does not have parentheses, it returns the character itself.The following programs illustrate the IntlChar::getBidiPairedBracket()function in PHP:Program 1: < tbody>  
// PHP function for illustration
// using IntlChar::getBidiPairedBracket()  
// Input data is numeric
var_dump (IntlChar::getBidiPairedBracket (91));  
// Input data is of the type in brackets var_dump (IntlChar::getBidiPairedBracket ( '[' )) ;  
// Input data is of the type in brackets var_dump (IntlChar::getBidiPairedBracket ( '}' )) ;  
// Input data is of the type in brackets var_dump (IntlChar::getBidiPairedBracket ( '" ' )) ;  
// Input data is of string type var_dump (IntlChar::getBidiPairedBracket ( 'ABC' ));  
// Input data is of character type var_dump (IntlChar::getBidiPairedBracket ( 'A' ));?> Exit:
int (93) string (1) "]" string (1) "{" string (1) "" "NULL string (1)" A "
Program 2:
// PHP code for illustration
// IntlChar::getBidiPairedBracket() 
// Declare the $arr array $arr = array ( "G" , "{" , "^" , ")" , "6" , "{}" , ")) " , " " );  
// run loop for each array element foreach ( $arr as $val ) { // Validate each element as code point data var_dump (IntlChar::getBidiPairedBracket ( $val )); }
?>
Exit:
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()
  • PHP | IntlChar charType() function
Link: http: // php. net / manual / en / intlchar.getbidipairedbracket.php