original_string: public static function getSlug($text, $separator = '-')
      {
          return strtolower(
              trim(
                  preg_replace('~[^0-9a-z]+~i', '-', html_entity_decode(
                      preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i', '$1', htmlentities(
                          $text, ENT_QUOTES, 'UTF-8'
                      )
                  ), ENT_QUOTES, 'UTF-8')
              ), $separator)
          );
      }
code: public static function getSlug($text, $separator = '-')
      {
          return strtolower(
              trim(
                  preg_replace('~[^0-9a-z]+~i', '-', html_entity_decode(
                      preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i', '$1', htmlentities(
                          $text, ENT_QUOTES, 'UTF-8'
                      )
                  ), ENT_QUOTES, 'UTF-8')
              ), $separator)
          );
      }
code_tokens: public static function getSlug ( $ text , $ separator = '-' ) { return strtolower ( trim ( preg_replace ( '~[^0-9a-z]+~i' , '-' , html_entity_decode ( preg_replace ( '~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i' , '$1' , htmlentities ( $ text , ENT_QUOTES , 'UTF-8' ) ) , ENT_QUOTES , 'UTF-8' ) ) , $ separator ) ) ; }
docstring: Transforms a given string into a URL safe "slug".
  
  @param  string $text
  @param  string $separator
  @return string
  
  Source: http://stackoverflow.com/questions/2103797/url-friendly-username-in-php
docstring_tokens: Transforms a given string into a URL safe slug .