Using the PHP Function mb_Convert_Case()
PHP has a huge range of built-in string-handling functions. There are strtolower() and strtoupper() for converting whole strings; lcfirst() and ucwords() for converting just the first letter of a string, and for converting words to upper case; and the mb_convert_case function for performing multibyte string conversion.
These functions are used when a developer needs to convert the case of a string. For instance, they are often used when performing a comparison between two string values, to ensure that the case of each value is consistent across different encodings. In PHP 7.3, the mb_convert_case() function improved its handling of case-insensitive operations by using case folding instead. This improves the efficiency of the function, and allows it to be used on multibyte string conversions without needing to specify an encoding.
The mb_convert_case() is called with the following parameters:
$string: The string to convert to the specified mode.
$encoding: The character encoding of the string. If this is omitted, the internal encoding will be used.
$mode: The string mode that the string is to be converted into.