src/KsUtils/Str.php
public static function slugabize($str, $defaultChar = "")
    {
        $str = mb_strtolower($str, 'UTF-8');
        $str = self::translit($str);

        /*if (!preg_match('|^[A-Za-z0-9\s_\.-]+$|', $str)) {
            die('Unknown symbol in string: ' . $str);
        }*/

        $str = preg_replace('~[^-a-z0-9_]+~u', $defaultChar, $str);

        return trim($str, $defaultChar);
    }
public static function slugabize($str, $defaultChar = "")
    {
        $str = mb_strtolower($str, 'UTF-8');
        $str = self::translit($str);

        /*if (!preg_match('|^[A-Za-z0-9\s_\.-]+$|', $str)) {
            die('Unknown symbol in string: ' . $str);
        }*/

        $str = preg_replace('~[^-a-z0-9_]+~u', $defaultChar, $str);

        return trim($str, $defaultChar);
    }
Returns a slugabized string (for example in url usage)
@param  string $str         Unslugabized string
@param  string $defaultChar Replacement for wrong chars
@return string Slugabized string. Contains only chars: a-z,0-9,-,_