PHP | IntlChar getFC_NFKC_Closure() Function
The IntlChar::getFC_NFKC_Closure() function is an inbuilt function in PHP which is used to get the FC_NFKC_Closure property for a code point. This function returns the FC_NFKC_Closure property string for the code point. If the code point is none then it returns an empty string.
Syntax:
string IntlChar::getFC_NFKC_Closure( $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 FC_NFKC_Closure property string for the code point, or an empty string if there is none.
Below programs illustrate the IntlChar::getFC_NFKC_Closure() function in PHP:
Program 1:
<?php
var_dump(IntlChar::getFC_NFKC_Closure( "\u{2121}" ));
var_dump(IntlChar::getFC_NFKC_Closure( "\u{1D2D}" ));
var_dump(IntlChar::getFC_NFKC_Closure( "\p{143}" ));
var_dump(IntlChar::getFC_NFKC_Closure( " " ));
var_dump(IntlChar::getFC_NFKC_Closure( "\u{350}" ));
var_dump(IntlChar::getFC_NFKC_Closure( "XYZ" ));
var_dump(IntlChar::getFC_NFKC_Closure( "\u{0358}" ));
?>
|
Output:
string(3) "tel"
string(2) "æ"
NULL
string(0) ""
string(0) ""
NULL
string(0) ""
Program 2:
<?php
$arr = array ( "\u{2121}" , "\u{1D2D}" , " " , "\u{350}" , "XYZ" , "G" ,
"GeeksforGeeks" , "^" );
foreach ( $arr as $val ){
var_dump(IntlChar::getFC_NFKC_Closure( $val ));
}
?>
|
Output:
string(3) "tel"
string(2) "æ"
string(0) ""
string(0) ""
NULL
string(0) ""
NULL
string(0) ""
Related Articles:
Reference: http://php.net/manual/en/intlchar.getfc-nfkc-closure.php
Last Updated :
03 Nov, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...