public static function splitCamelCase($input, $separator = '_', $toLower = true): string
    {
        $original = $input;

        $output = preg_replace(['/(?<=[^A-Z])([A-Z])/', '/(?<=[^0-9])([0-9])/'], '_$0', $input);
        $output = preg_replace('#_{1,}#', $separator, $output);

        $output = trim($output);
        if ($toLower) {
            $output = strtolower($output);
        }

        if ('' === $output) {
            return $original;
        }

        return $output;
    }
public static function splitCamelCase($input, $separator = '_', $toLower = true): string
    {
        $original = $input;

        $output = preg_replace(['/(?<=[^A-Z])([A-Z])/', '/(?<=[^0-9])([0-9])/'], '_$0', $input);
        $output = preg_replace('#_{1,}#', $separator, $output);

        $output = trim($output);
        if ($toLower) {
            $output = strtolower($output);
        }

        if ('' === $output) {
            return $original;
        }

        return $output;
    }
public static function splitCamelCase ( $ input , $ separator = '_' , $ toLower = true ) : string { $ original = $ input ; $ output = preg_replace ( [ '/(?<=[^A-Z])([A-Z])/' , '/(?<=[^0-9])([0-9])/' ] , '_$0' , $ input ) ; $ output = preg_replace ( '#_{1,}#' , $ separator , $ output ) ; $ output = trim ( $ output ) ; if ( $ toLower ) { $ output = strtolower ( $ output ) ; } if ( '' === $ output ) { return $ original ; } return $ output ; }
Convert camel case to human readable format

@param string $input
@param string $separator
@param bool   $toLower *
@return string
Convert camel case to human readable format