Created
September 6, 2019 14:14
-
-
Save erdemoflaz/797fb971c03ddadc8de95cd5b8fcaf1e to your computer and use it in GitHub Desktop.
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
// türkçe karakterleri bozmadan olması gerektiği gibi encode edip basan kod parçası | |
// not: $encoding = 'UTF-8' | |
public function mb_ucfirst($string, $encoding) | |
{ | |
$strlen = mb_strlen($string, $encoding); | |
$firstChar = mb_substr($string, 0, 1, $encoding); | |
$then = mb_strtolower(mb_substr($string, 1, $strlen - 1, $encoding), $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