PHP | IntlChar getCombiningClass() Function
Last Updated :
04 Nov, 2020
The IntlChar::getCombiningClass() function is an inbuilt function in PHP which is used to get the combining class of the code point.
Syntax:
int IntlChar::getCombiningClass ( $codepoint )
Parameters: This function accepts a 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 combining class of the code point.
Below programs illustrate the IntlChar::getCombiningClass() function in PHP:
Program 1:
PHP
<?php
var_dump(IntlChar::getCombiningClass( "\p{143}" ));
var_dump(IntlChar::getCombiningClass( " " ));
var_dump(IntlChar::getCombiningClass( "\u{350}" ));
var_dump(IntlChar::getCombiningClass( "XYZ" ));
var_dump(IntlChar::getCombiningClass( "\u{0358}" ));
?>
|
Output:
NULL
int(0)
int(230)
NULL
int(232)
Program 2:
PHP
<?php
$arr = array ( "\u{314}" , "GeeksforGeeks" , "^" , "\u{0324}" , "6" , "\n" );
foreach ( $arr as $val ){
var_dump(IntlChar::getCombiningClass( $val ));
}
?>
|
Output:
int(230)
NULL
int(0)
int(220)
int(0)
int(0)
Related Articles:
Reference: http://php.net/manual/en/intlchar.getcombiningclass.php
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...