Last active
June 30, 2017 10:41
-
-
Save amirkhiz/32129e9efabb54a5d27dc518d585d13b to your computer and use it in GitHub Desktop.
Turkish Capitalize (Title case) for string
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
function titleCaseTurkish($string) | |
{ | |
$temp = preg_split("/\s/u", $string, -1, PREG_SPLIT_NO_EMPTY); | |
foreach ($temp as &$item) { | |
$item = str_replace("i", "İ", $item); | |
} | |
$temp = join(' ', $temp); | |
return mb_convert_case($temp, MB_CASE_TITLE, "UTF-8"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment