src/Utilities/Regex.php
public static function createSlug($value)
    {
        /*
         * Not a scalar value?
         * Nothing to do
         */
        if (!is_scalar($value)) {
            return false;
        }

        /*
         * It's an empty string?
         * Nothing to do
         */
        if ('' === $value) {
            return '';
        }

        $id = 'Latin-ASCII; NFD; [:Nonspacing Mark:] Remove; NFC; [:Punctuation:] Remove; Lower();';
        $transliterator = \Transliterator::create($id);

        $cleanValue = trim($value);
        $result = $transliterator->transliterate($cleanValue);

        return preg_replace('/[-\s]+/', '-', $result);
    }
public static function createSlug($value)
    {
        /*
         * Not a scalar value?
         * Nothing to do
         */
        if (!is_scalar($value)) {
            return false;
        }

        /*
         * It's an empty string?
         * Nothing to do
         */
        if ('' === $value) {
            return '';
        }

        $id = 'Latin-ASCII; NFD; [:Nonspacing Mark:] Remove; NFC; [:Punctuation:] Remove; Lower();';
        $transliterator = \Transliterator::create($id);

        $cleanValue = trim($value);
        $result = $transliterator->transliterate($cleanValue);

        return preg_replace('/[-\s]+/', '-', $result);
    }
public static function createSlug ( $ value ) { /*
         * Not a scalar value?
         * Nothing to do
         */ if ( ! is_scalar ( $ value ) ) { return false ; } /*
         * It's an empty string?
         * Nothing to do
         */ if ( '' === $ value ) { return '' ; } $ id = 'Latin-ASCII; NFD; [:Nonspacing Mark:] Remove; NFC; [:Punctuation:] Remove; Lower();' ; $ transliterator = \ Transliterator :: create ( $ id ) ; $ cleanValue = trim ( $ value ) ; $ result = $ transliterator -> transliterate ( $ cleanValue ) ; return preg_replace ( '/[-\s]+/' , '-' , $ result ) ; }
Returns slug for given value

@param string $value Value that should be transformed to slug
@return bool|string
Returns slug for given value