diff options
| author | Urban Müller | 2026-07-22 17:24:27 +0200 |
|---|---|---|
| committer | Urban Müller | 2026-07-22 17:24:27 +0200 |
| commit | a10ad584578b8b3e92bf75fd61c5545d985e4527 (patch) | |
| tree | 340d0ed6149d2bdbf6dddf70a65edfb61502885d /it.class | |
| parent | 8690f3d9216a386f21237eee2f9412f1451e17bf (diff) | |
| download | itools-a10ad584578b8b3e92bf75fd61c5545d985e4527.tar.gz itools-a10ad584578b8b3e92bf75fd61c5545d985e4527.tar.bz2 itools-a10ad584578b8b3e92bf75fd61c5545d985e4527.zip | |
modernize implementation
Diffstat (limited to 'it.class')
| -rw-r--r-- | it.class | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -623,7 +623,7 @@ static function any2utf8($value, $errprefix = "") */ static function ucfirst($string) { - return mb_strtoupper(mb_substr($string, 0, 1)) . mb_substr($string, 1); + return mb_ucfirst($string); } /** @@ -631,7 +631,7 @@ static function ucfirst($string) */ static function lcfirst($string) { - return mb_strtolower(mb_substr($string, 0, 1)) . mb_substr($string, 1); + return mb_lcfirst($string); } /** @@ -639,7 +639,7 @@ static function lcfirst($string) */ static function ucwords($string) { - return preg_replace_callback('/\b\w/u', function($m) { return mb_strtoupper($m[0]); }, mb_strtolower($string)); + return mb_convert_case($string, MB_CASE_TITLE, "UTF-8"); } static function substr_replace($string, $replacement, $start, $length) |