Open In App

PHP | IntlChar foldCase() Function

Last Updated : 25 Mar, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

The IntlChar::foldCase() function is an inbuilt function in PHP which is used to perform case folding on a code point. Case folding means the given character is mapped to its equivalent lowercase characters.
Syntax: 
 

mixed IntlChar::foldCase( $codepoint, $options = 
IntlChar::FOLD_CASE_DEFAULT )

Parameters: This function accepts two parameters as mentioned above and described below: 
 

  • $codepoint: This parameter is a character or integer value, which is encoded as a UTF-8 string.
  • $options: This parameter holds the character constants IntlChar::FOLD_CASE_DEFAULT by default or IntlChar::FOLD_CASE_EXCLUDE_SPECIAL_I.

Return Value: This function returns Simple_Case_Folding of the codepoint. If the codepoint has no case folding equivalent, then the codepoint itself is returned.
Below program illustrates the IntlChar::foldCase() function in PHP:
Program: 
 

php




<?php
// PHP program to illustrate the IntlChar::foldCase() function
 
var_dump(IntlChar::foldCase('AA', IntlChar::FOLD_CASE_EXCLUDE_SPECIAL_I));
 
var_dump(IntlChar::foldCase('@', IntlChar::FOLD_CASE_EXCLUDE_SPECIAL_I));
 
var_dump(IntlChar::foldCase('&', IntlChar::FOLD_CASE_EXCLUDE_SPECIAL_I));
 
var_dump(IntlChar::foldCase('C', IntlChar::FOLD_CASE_DEFAULT));
 
var_dump(IntlChar::foldCase('Lt', IntlChar::FOLD_CASE_DEFAULT));
 
var_dump(IntlChar::foldCase('/', IntlChar::FOLD_CASE_DEFAULT));
 
var_dump(IntlChar::foldCase('g', IntlChar::FOLD_CASE_DEFAULT));
 
var_dump(IntlChar::foldCase('1', IntlChar::FOLD_CASE_DEFAULT));
 
?>


Output: 

NULL
string(1) "@"
string(1) "&"
string(1) "c"
NULL
string(1) "/"
string(1) "g"
string(1) "1"

 

Reference: https://www.php.net/manual/en/intlchar.foldcase.php
 


Similar Reads

PHP | IntlChar::isJavaIDStart() Function
The IntlChar::isJavaIDStart() function is an inbuilt function in PHP which is used to check whether the input character code point is permissible since the first character is a java identifier or not. It is True for characters with general category "Sc" (Currency Symbols), and "Pc" (Connecting Punctuation). Syntax: bool IntlChar::isJavaIDStart( $co
2 min read
PHP | IntlChar::isJavaSpaceChar() Function
The IntlChar::isJavaSpaceChar() function is an inbuilt function in PHP which is used to check whether the input character code point is a space character or not according to Java. Its value is True for characters with general category "Z" (Separators), which does not include control character.Syntax: bool IntlChar::isJavaSpaceChar( $codepoint ) Par
2 min read
PHP | IntlChar::iscntrl() Function
The IntlChar::iscntrl() function is an inbuilt function in PHP which is used to check the given input is a control character or not. Control characters are line feed, tab, escape, etc. A control character is one of the following types: ISO 8-bit control character (U+0000..U+001f and U+007f..U+009f)IntlChar::CHAR_CATEGORY_CONTROL_CHAR (Cc)IntlChar::
2 min read
PHP | IntlChar::isdigit() Function
The IntlChar::isdigit() function is an inbuilt function in PHP which is used to determine the given input code data is a digited character or not. It returns true when the character is under the general category decimal digit numbers. Beginning with Unicode 4, this is the same as testing for the Numeric_Type of Decimal. Syntax: bool IntlChar::isdig
2 min read
PHP | IntlChar::isblank() Function
The IntlChar::isblank() function is an inbuilt function in PHP which is used to determine the given input code data is blank or horizontal space character and the character visible separates words on a line. If the input contains U+0009 (TAB) and characters "Zs" (space separators) except Zero Width Space (ZWSP, U+200B) then it will be True. A Unico
2 min read
PHP | IntlChar::isalpha() Function
The IntlChar::isalpha() function is an inbuilt function in PHP which is used to check the given input is an alphanumeric character or not. Syntax: bool IntlChar::isalpha( $codepoint ) Parameters: The IntlChar::isalpha() function accept single parameter $codepoint which is mandatory. The input parameter is an integer value or character, which is enc
1 min read
PHP IntlChar::isbase() Function
PHP IntlChar::isbase() function is an inbuilt function in PHP that is used to check whether the given input data is a base character or not. If the specified code point is a base character then it returns TRUE for general categories "L" (Letters), "N" (numbers), "Mc" (spacing combining marks), and "Me" (enclosing marks). Syntax: bool IntlChar::isba
2 min read
PHP | IntlChar::isalnum () Function
The IntlChar::isalnum() function is an inbuilt function in PHP which is used to check the given input is an alphanumeric character (Digit or Letter) or not. It returns TRUE for characters with general categories "L" (letters) and "Nd" (decimal digit numbers). Syntax: bool IntlChar::isalnum( $codepoint ) Parameters: This function accepts single para
2 min read
PHP | IntlChar::isprint() Function
The IntlChar::isprint() function is an inbuilt function in PHP which is used to check whether the given input character is a printable character or not. Syntax: bool IntlChar::isprint( $codepoint ) Parameters: This function accepts a single parameter $codepoint which is mandatory. The input parameter is an integer values or character, which is enco
2 min read
PHP | IntlChar::isupper() Function
The IntlChar::isupper() function is an inbuilt function in PHP which is used to check whether the given input character is an uppercase character or not. Syntax: bool IntlChar::isupper( $codepoint ) Parameters: This function accepts a single parameter $codepoint which is mandatory. The input parameter is a character, which is encoded as a UTF-8 str
2 min read
Article Tags :