Created
June 9, 2015 13:33
-
-
Save zakxxi/091ac5cb1fb8fddfb9f3 to your computer and use it in GitHub Desktop.
Composed names > UPPERCASE to Capitalize-Capitalize Capitalize (PHP)
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
$string = "BÉBÉ-ROSE CADUM CADUM"; | |
$parts = explode("-", $string); | |
$output_parts = array(); | |
foreach ($parts as $part) { | |
$output_parts[] = ucwords(mb_strtolower($part)); | |
} | |
$string = implode("-", $output_parts); | |
print $string; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment