The IntlChar::isIDIgnorable() function is an inbuilt function in PHP which is used to determine the code point is an ignorable character or not. It is TRUE for characters with general category “Cf” (format controls) as well as non-whitespace ISO controls ( U+0000…U+0008, U+000E…U+001B, U+007F…U+009F).
Syntax:
bool IntlChar::isIDIgnorable( $codepoint )
Parameters: This function accepts a single parameter $codepoint which is mandatory. It is a character or integer value, which is encoded as UTF-8 string.
Return Value: If $codepoint is an ignorable identifier then returns True, otherwise return False.
Below programs illustrate the IntlChar::isIDIgnorable() Function in PHP.
Program 1:
<?php
var_dump(IntlChar::isIDIgnorable( "X" ));
echo "<br>" ;
var_dump(IntlChar::isIDIgnorable( "^ " ));
echo "<br>" ;
var_dump(IntlChar::isIDIgnorable( "3 " ));
echo "<br>" ;
var_dump(IntlChar::isIDIgnorable( "\u{007F}" ));
echo "<br>" ;
var_dump(IntlChar::isIDIgnorable( "\u{012C}" ));
echo "<br>" ;
var_dump(IntlChar::isIDIgnorable( "Geeks" ));
echo "<br>" ;
?>
|
Output:
bool(false)
NULL
NULL
bool(true)
bool(false)
NULL
Program 2:
<?php
$arr = array ( "G" , "\u{007F}" , "." , "8" , "/" ,
"\u{000}" , "\t" , "\u{007}" , "\u{0AB}" );
foreach ( $arr as $val ){
var_dump(IntlChar::isIDIgnorable( $val ));
echo "<br>" ;
}
?>
|
Output:
bool(false)
bool(true)
bool(false)
bool(false)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
Related Articles:
Reference: http://php.net/manual/en/intlchar.isidignorable.php