src/Text.php
public static function camelize($string, $separator = '_') : string
    {
        if(is_array($separator))
        {
            $separator = "(\\" . implode("|\\", $separator) . ")";
        }
        else
        {
            $separator = '\\' . $separator;
        }
        return preg_replace_callback(
            "/{$separator}[a-zA-Z]/", 
            function ($matches) 
            {
                return strtoupper($matches[0][1]);
            }, 
            strtolower($string)
        );
    }
public static function camelize($string, $separator = '_') : string
    {
        if(is_array($separator))
        {
            $separator = "(\\" . implode("|\\", $separator) . ")";
        }
        else
        {
            $separator = '\\' . $separator;
        }
        return preg_replace_callback(
            "/{$separator}[a-zA-Z]/", 
            function ($matches) 
            {
                return strtoupper($matches[0][1]);
            }, 
            strtolower($string)
        );
    }
public static function camelize ( $ string , $ separator = '_' ) : string { if ( is_array ( $ separator ) ) { $ separator = "(\\" . implode ( "|\\" , $ separator ) . ")" ; } else { $ separator = '\\' . $ separator ; } return preg_replace_callback ( "/{$separator}[a-zA-Z]/" , function ( $ matches ) { return strtoupper ( $ matches [ 0 ] [ 1 ] ) ; } , strtolower ( $ string ) ) ; }
Converts text separated by a specified separator to camel case.
This function converts the entire text into lower case before performing the
camel case conversion. Due to this the first character would be lowercased.

@param string $string The text to be converted.
@param string $separator The separator to consider for camel casing
@return string
Converts text separated by a specified separator to camel case . This function converts the entire text into lower case before performing the camel case conversion . Due to this the first character would be lowercased .