src/etc/StringUtils.php
public static function slugify($string)
    {
        // Replace non-alpha-numerics with dashes
        $string = strtolower(preg_replace(array('/[^a-zA-Z0-9 -]/','/[ -]+/','/^-|-$/'), array('','-',''), $string));

        // Trim dashes from the left side of the string
        $string = ltrim($string, "-");

        // Trim dashes from the right side of the string
        $string = rtrim($string, '-');

        return $string;
    }
public static function slugify($string)
    {
        // Replace non-alpha-numerics with dashes
        $string = strtolower(preg_replace(array('/[^a-zA-Z0-9 -]/','/[ -]+/','/^-|-$/'), array('','-',''), $string));

        // Trim dashes from the left side of the string
        $string = ltrim($string, "-");

        // Trim dashes from the right side of the string
        $string = rtrim($string, '-');

        return $string;
    }
public static function slugify ( $ string ) { // Replace non-alpha-numerics with dashes $ string = strtolower ( preg_replace ( array ( '/[^a-zA-Z0-9 -]/' , '/[ -]+/' , '/^-|-$/' ) , array ( '' , '-' , '' ) , $ string ) ) ; // Trim dashes from the left side of the string $ string = ltrim ( $ string , "-" ) ; // Trim dashes from the right side of the string $ string = rtrim ( $ string , '-' ) ; return $ string ; }
Turn a string into a slug

@param string $string
@return string
Turn a string into a slug