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;
    }