Created
September 19, 2014 17:04
-
-
Save cawa87/da3ef7739f05b643ccb6 to your computer and use it in GitHub Desktop.
mb_ucfirst
This file contains 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 | |
function mb_ucfirst($string, $encoding) | |
{ | |
$strlen = mb_strlen($string, $encoding); | |
$firstChar = mb_substr($string, 0, 1, $encoding); | |
$then = mb_substr($string, 1, $strlen - 1, $encoding); | |
return mb_strtoupper($firstChar, $encoding) . $then; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment