Created
December 17, 2024 18:20
-
-
Save alexandreelise/7463bd139c7bf53bcb2b177db27e7d1a to your computer and use it in GitHub Desktop.
Solution ucfirst bug when string is already in ALLCAPS in php one-liner
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 | |
// Solution ucfirst bug when string is already in ALLCAPS | |
$result = (isset($givenString) && !empty(trim($givenString)) ? mb_ucfirst(mb_strtolower($givenString)) : ''); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment