src/Input.php
public static function toSlug($string, $replace = array(), $delimiter = '-')
    {
        if (!empty($replace)) {
            $string = str_replace((array) $replace, ' ', $string);
        }

        return preg_replace('/[^A-Za-z0-9-]+/', $delimiter, $string);
    }
public static function toSlug($string, $replace = array(), $delimiter = '-')
    {
        if (!empty($replace)) {
            $string = str_replace((array) $replace, ' ', $string);
        }

        return preg_replace('/[^A-Za-z0-9-]+/', $delimiter, $string);
    }
public static function toSlug ( $ string , $ replace = array ( ) , $ delimiter = '-' ) { if ( ! empty ( $ replace ) ) { $ string = str_replace ( ( array ) $ replace , ' ' , $ string ) ; } return preg_replace ( '/[^A-Za-z0-9-]+/' , $ delimiter , $ string ) ; }
This function expects the input to be UTF-8 encoded.
This function expects the input to be UTF - 8 encoded .