src/BaconStringUtils/Slugifier.php
public function slugify($string)
    {
        $decoder = $this->getUniDecoder();

        if (null !== $decoder) {
            $string = $decoder->decode($string);
        }

        $string = strtolower($string);
        $string = str_replace("'", '', $string);
        $string = preg_replace('([^a-zA-Z0-9_-]+)', '-', $string);
        $string = preg_replace('(-{2,})', '-', $string);
        $string = trim($string, '-');

        return $string;
    }
public function slugify($string)
    {
        $decoder = $this->getUniDecoder();

        if (null !== $decoder) {
            $string = $decoder->decode($string);
        }

        $string = strtolower($string);
        $string = str_replace("'", '', $string);
        $string = preg_replace('([^a-zA-Z0-9_-]+)', '-', $string);
        $string = preg_replace('(-{2,})', '-', $string);
        $string = trim($string, '-');

        return $string;
    }
public function slugify ( $ string ) { $ decoder = $ this -> getUniDecoder ( ) ; if ( null !== $ decoder ) { $ string = $ decoder -> decode ( $ string ) ; } $ string = strtolower ( $ string ) ; $ string = str_replace ( "'" , '' , $ string ) ; $ string = preg_replace ( '([^a-zA-Z0-9_-]+)' , '-' , $ string ) ; $ string = preg_replace ( '(-{2,})' , '-' , $ string ) ; $ string = trim ( $ string , '-' ) ; return $ string ; }
Slugifies a string.

@param  string $string
@return string
Slugifies a string .