PHP IntlChar tolower () function

PHP

Syntax:
mixed IntlChar::tolower ($codepoint)
Parameters: This function takes one parameter, $codepoint which is required. The input parameter is a character that is encoded as a UTF-8 string.Return Value:This function returns the lowercase display character for the given character. If the character does not have a lowercase-mapped character, it returns itself. The return type will be integer, unless the code point was passed as a UTF-8 string, in which case the string will be returned.The programs below illustrate the IntlChar::tolower() functionin PHP:Program 1:  
// PHP illustration program
// IntlChar::tolower function 
// Input data - top character register var_dump (IntlChar::tolower ( "A" ));  
// Input - lower case var_dump (IntlChar::tolower ( "a" ));  
// Input is a number character var_dump (IntlChar::tolower ( "1" ));  
// Input is a string character var_dump (IntlChar::tolower (ord ( "XYZ" )) );  
// Input - upper case var_dump (IntlChar::tolower (ord ( "I" ) )); ?>
Exit:
string (1 ) "a" string (1) "a" string (1) "1" int (120) int (105)
Program 2:
// PHP code for illustration IntlChar::tolower()  
// Declare the $arr array $arr = array (ord ( "A" ), "291" , "^" , "A" , "a" , "1" );  
// run loop for each array element foreach ( $arr as $val ) { // Validate each element as code point data var_dump (IntlChar::tolower ( $val )); }
?>
Exit:
int (97 ) NULL string (1) "^" string (1) "a" string (1) "a" string (1) "1"
Related Articles:
  • PHP | IntlChar::islower() Function
  • PHP | IntlChar::isupper() function
Link: http://php.net/manual/en/intlchar.tolower.php



Get Solution for free from DataCamp guru