Last active
March 6, 2020 08:20
-
-
Save alpenzoo/05204fe22e9ba228fe2d05dc2b056b77 to your computer and use it in GitHub Desktop.
php upper lower for standard en chars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
setlocale(LC_CTYPE, 'de_DE.UTF8'); | |
function myUpper($char){ | |
$lo = ord($char); | |
$up = $lo & 0x5f; | |
return $up; | |
} | |
function myLower($char){ | |
$up = ord($char); | |
$lo = $up ^ 0x20; | |
return $lo; | |
} | |
echo chr(myUpper('h')); | |
echo strtoupper('ô'); | |
echo mb_convert_case('ô', MB_CASE_UPPER, "UTF-8"); | |
// see also https://gitlab.snuipp.fr/snusoft/api_carte_scolaire/blob/master/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment