PHP | IntlChar::isISOControl() Function
Last Updated :
04 Nov, 2020
The IntlChar::isISOControl() function is an inbuilt function in PHP which is used to check whether the input code point is an ISO control code character or not. Specified code point to be determined whether the code point is ISO control code. It is True for general category “Cc” as U+0000…U+001f and U+007f…U+009f.
Syntax:
bool IntlChar::isISOControl( $codepoint )
Parameters: This function accepts a single parameter $codepoint which is mandatory. The input parameter is a character or integer value, which is encoded as a UTF-8 string.
Return Value: If $codepoint is an ISO control code character then returns True, otherwise return False.
Note: If input code point parameter is String and Numbers then it returns NULL.
Below programs illustrate the IntlChar::isISOControl() Function in PHP:
Program 1:
PHP
<?php
var_dump(IntlChar::isISOControl( "\n" ));
var_dump(IntlChar::isISOControl( '\n' ));
var_dump(IntlChar::isISOControl( "Sudo\tPlacement" ));
var_dump(IntlChar::isISOControl( "3 " ));
var_dump(IntlChar::isISOControl( "1\n2\n3\n4\n " ));
var_dump(IntlChar::isISOControl( "33.44" ));
var_dump(IntlChar::isISOControl( "\u{007F}" ));
var_dump(IntlChar::isISOControl( " @ " ));
?>
|
Output:
bool(true)
NULL
NULL
NULL
NULL
NULL
bool(true)
NULL
Program 2:
PHP
<?php
$arr = array ( "\r" ,
"." ,
" " ,
"\n" ,
"\u" ,
" " ,
"\t" ,
"\\" ,
);
foreach ( $arr as $val ) {
var_dump(IntlChar::isISOControl( $val ));
}
?>
|
Output:
bool(true)
bool(false)
bool(false)
bool(true)
NULL
bool(false)
bool(true)
bool(false)
Related Articles:
Reference: http://php.net/manual/en/intlchar.isisocontrol.php
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...