public static function splitCamelCase(string $string, string $glue = ' '): string
    {
        $expression = '/(?#! splitCamelCase Rev:20140412)
                        # Split camelCase "words". Two global alternatives. Either g1of2:
                          (?<=[a-z])      # Position is after a lowercase,
                          (?=[A-Z])       # and before an uppercase letter.
                        | (?<=[A-Z])      # Or g2of2; Position is after uppercase,
                          (?=[A-Z][a-z])  # and before upper-then-lower case.
                        /x';
        $split = preg_split($expression, $string);
        $output = [];
        $count = count($split);
        for ($i = 0; $i < $count; ++$i) { // @todo: rework me with foreach() cycle
            $word = strtolower($split[$i]);
            if ($i === 0) {
                $word = ucfirst($word);
            }
            $output[] = $word;
        }

        return implode($glue, $output);
    }
public static function splitCamelCase(string $string, string $glue = ' '): string
    {
        $expression = '/(?#! splitCamelCase Rev:20140412)
                        # Split camelCase "words". Two global alternatives. Either g1of2:
                          (?<=[a-z])      # Position is after a lowercase,
                          (?=[A-Z])       # and before an uppercase letter.
                        | (?<=[A-Z])      # Or g2of2; Position is after uppercase,
                          (?=[A-Z][a-z])  # and before upper-then-lower case.
                        /x';
        $split = preg_split($expression, $string);
        $output = [];
        $count = count($split);
        for ($i = 0; $i < $count; ++$i) { // @todo: rework me with foreach() cycle
            $word = strtolower($split[$i]);
            if ($i === 0) {
                $word = ucfirst($word);
            }
            $output[] = $word;
        }

        return implode($glue, $output);
    }
public static function splitCamelCase ( string $ string , string $ glue = ' ' ) : string { $ expression = '/(?#! splitCamelCase Rev:20140412)
                        # Split camelCase "words". Two global alternatives. Either g1of2:
                          (?<=[a-z])      # Position is after a lowercase,
                          (?=[A-Z])       # and before an uppercase letter.
                        | (?<=[A-Z])      # Or g2of2; Position is after uppercase,
                          (?=[A-Z][a-z])  # and before upper-then-lower case.
                        /x' ; $ split = preg_split ( $ expression , $ string ) ; $ output = [ ] ; $ count = count ( $ split ) ; for ( $ i = 0 ; $ i < $ count ; ++ $ i ) { // @todo: rework me with foreach() cycle $ word = strtolower ( $ split [ $ i ] ) ; if ( $ i === 0 ) { $ word = ucfirst ( $ word ) ; } $ output [ ] = $ word ; } return implode ( $ glue , $ output ) ; }
Split camel case words with glue. camelCaseWords => Camel case words
@param string $string
@param string $glue
@return string
Split camel case words with glue . camelCaseWords = > Camel case words