src/Text.php
public static function deCamelize($string, $separator = '_') : string
    {
        return preg_replace_callback(
            "/[A-Z][a-z]/", 
            function ($matches) use($separator) 
            {
                return $separator . strtolower($matches[0]);
            }, 
            lcfirst($string)
        );        
    }
public static function deCamelize($string, $separator = '_') : string
    {
        return preg_replace_callback(
            "/[A-Z][a-z]/", 
            function ($matches) use($separator) 
            {
                return $separator . strtolower($matches[0]);
            }, 
            lcfirst($string)
        );        
    }
public static function deCamelize ( $ string , $ separator = '_' ) : string { return preg_replace_callback ( "/[A-Z][a-z]/" , function ( $ matches ) use ( $ separator ) { return $ separator . strtolower ( $ matches [ 0 ] ) ; } , lcfirst ( $ string ) ) ; }
Converts camel case text into regular text separated with an arbitrary separator.
By default the seperator is an underscore. A space can also be used as the
seperator in cases where the conversion is to an English sentence.

@param string $string The text to be converted.
@param string $separator The separator to be used.
@return string
Converts camel case text into regular text separated with an arbitrary separator . By default the seperator is an underscore . A space can also be used as the seperator in cases where the conversion is to an English sentence .