Created
October 29, 2019 00:57
-
-
Save mattkomarnicki/c303cf6d2497a40776998a8e404940ac 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
<?php | |
private function camelCaseToHuman(string $input): string | |
{ | |
$result = preg_split('/(^[^A-Z]+|[A-Z][^A-Z]+)/', $input, -1, PREG_SPLIT_NO_EMPTY| PREG_SPLIT_DELIM_CAPTURE); | |
return ucfirst(implode(' ', $result)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment