PHP | IntlChar::isISOControl() Function

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 single parameter $codepoint which is mandatory. The input parameter is a character or interger 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:

filter_none

edit
close

play_arrow

link
brightness_4
code

<?php
// PHP code to illustrate
// IntlChar::isISOControl() function
   
// Input control with double " " 
// character codepoint value 
var_dump(IntlChar::isISOControl("\n"));
echo "<br>";
  
// Input control with single ''
// character codepoint value 
var_dump(IntlChar::isISOControl('\n'));
echo "<br>";
  
// Input string codepoint value 
var_dump(IntlChar::isISOControl("Sudo\tPlacement"));
echo "<br>";
   
// Input int codepoint value 
var_dump(IntlChar::isISOControl("3 "));
echo "<br>";
  
// Input int codepoint value 
var_dump(IntlChar::isISOControl("1\n2\n3\n4\n "));
echo "<br>";
  
// Input floating codepoint value 
var_dump(IntlChar::isISOControl("33.44"));
echo "<br>";
   
// Input int char an identifier
// of codepoint value
var_dump(IntlChar::isISOControl("\u{007F}"));
echo "<br>";
  
// Input symbolic codepoint value 
var_dump(IntlChar::isISOControl(" @ "));
echo "<br>";
?>

chevron_right


Output:

bool(true)
NULL
NULL
NULL
NULL
NULL
bool(true)
NULL

Program 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

<?php
// PHP code to illustrate
// IntlChar::isIStart() function
// Declare an array with
// different codepoint value 
$arr = array("\r"
             ".",
             " "
             "\n",
             "\u",
             " ",
             "\t",
             "\\",
        );
   
// For loop condition to check 
// each character through function
foreach ($arr as $val) {
       
    // Check each element as code point data
    var_dump(IntlChar::isISOControl($val));
    echo "<br>";
}
?>

chevron_right


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



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.