public static function slugify($str, $replace = array(), $delimiter = '-')
    {
        if (!empty($replace)) {
            $str = str_replace((array)$replace, ' ', $str);
        }

        $clean = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str);
        $clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $clean);
        $clean = strtolower(trim($clean, '-'));
        $clean = preg_replace("/[\/_|+ -]+/", $delimiter, $clean);

        return $clean;
    }
public static function slugify($str, $replace = array(), $delimiter = '-')
    {
        if (!empty($replace)) {
            $str = str_replace((array)$replace, ' ', $str);
        }

        $clean = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str);
        $clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $clean);
        $clean = strtolower(trim($clean, '-'));
        $clean = preg_replace("/[\/_|+ -]+/", $delimiter, $clean);

        return $clean;
    }
public static function slugify ( $ str , $ replace = array ( ) , $ delimiter = '-' ) { if ( ! empty ( $ replace ) ) { $ str = str_replace ( ( array ) $ replace , ' ' , $ str ) ; } $ clean = iconv ( 'UTF-8' , 'ASCII//TRANSLIT//IGNORE' , $ str ) ; $ clean = preg_replace ( "/[^a-zA-Z0-9\/_|+ -]/" , '' , $ clean ) ; $ clean = strtolower ( trim ( $ clean , '-' ) ) ; $ clean = preg_replace ( "/[\/_|+ -]+/" , $ delimiter , $ clean ) ; return $ clean ; }
Convert a string to url friendly slug

@param string $str
@param array $replace
@param string $delimiter

@return mixed|string
Convert a string to url friendly slug