+

PHP IntlChar :: isbase () Function

Syntax:
bool IntlChar::isbase ($codepoint)
Parameters: This function takes a single $codepoint parameter which is required. The input parameter is an integer or a character that is encoded as a UTF-8 string.Returned value:if $codepoint is a base character, it returns TRUE, otherwise returns FALSE.Examples:
Input: (IntlChar::isbase ("D")) Output: bool (true) Input: (IntlChar::isbase ("*")) Output: bool (false) Input: (IntlChar::isbase ("9")); Output: bool (true)
The following programs illustrate the IntlChar::isbase()function in PHP:
Program 1:  
// PHP code for illustration IntlChar::isbase()
// Function 
// Input data is of character type var_dump (IntlChar::isbase ( "D" ));  
// Input data is of string type var_dump (IntlChar::isbase ( "Geeksforengineer" ));  
// Input data of integer type var_dump (IntlChar::isbase ( "234" ));  
// The input data has a special character type var_dump (IntlChar::isbase ( "*" ));  
?>
Output:
bool (true ) NULL NULL bool (false)
Program 2: < table border = "0" cellpadding = "0" cellspacing = "0">
// PHP code for illustration isbase() 
// Declare the $arr array $arr = array ( "4" , "20001111" , "^" , " " , "*" , "GeeksforGeeks" );  
// run loop for each array element foreach ( $arr as $val ) { // Validate each element as code point data var_dump (IntlChar::isbase ( $val )); }
?>
Output:
bool (true ) NULL bool (false) NULL bool (false) NULL
Related Articles:
  • PHP | IntlChar::isdigit() function
  • PHP | IntlChar::isblank() function
Link: http://php.net/manual/en/intlchar.isbase.php
Get Solution for free from DataCamp guru