library/Benri/Util/String.php
public static function dasherize($str, $replacement = '_')
    {
        return preg_replace_callback(
            '/([A-Z0-9-\s]+)/',
            function ($match) use ($replacement) {
                return $replacement . strtolower($match[1]);
            }, lcfirst($str)
        );
    }
public static function dasherize($str, $replacement = '_')
    {
        return preg_replace_callback(
            '/([A-Z0-9-\s]+)/',
            function ($match) use ($replacement) {
                return $replacement . strtolower($match[1]);
            }, lcfirst($str)
        );
    }
Returns given string as a dash_erized word.

@param string $str String to dasherize
@param string $replacement Replacement to be used as "dash"
@return string The dash_erized form of the given `$str`