The CakePHP framework API is a treasure trove of often undiscovered methods and functionality. Recently I came across the Inflector Class methods and noticed the “slug” method close to the bottom of the documentation, which is documented thus:
Returns a string with all spaces converted to underscores (by default), accented characters converted to non-accented characters, and non word characters removed.