Tutorialspoint.dev

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:

<?php
// PHP code to illustrate
// IntlChar::isISOControl() function
   
// Input control with double " " 
// character codepoint value 
var_dump(IntlChar::isISOControl(" "));
echo "<br>";
  
// Input control with single ''
// character codepoint value 
var_dump(IntlChar::isISOControl(' '));
echo "<br>";
  
// Input string codepoint value 
var_dump(IntlChar::isISOControl("Sudo Placement"));
echo "<br>";
   
// Input int codepoint value 
var_dump(IntlChar::isISOControl("3 "));
echo "<br>";
  
// Input int codepoint value 
var_dump(IntlChar::isISOControl("1 2 3 4 "));
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>";
?>

Output:

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

Program 2:

<?php
// PHP code to illustrate
// IntlChar::isIStart() function
// Declare an array with
// different codepoint value 
$arr = array(" "
             ".",
             " "
             " ",
             "u",
             " ",
             " ",
             "\",
        );
   
// 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>";
}
?>

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



This article is attributed to GeeksforGeeks.org

You Might Also Like

leave a comment

code

0 Comments

load comments

Subscribe to Our Newsletter