Skip to content

Instantly share code, notes, and snippets.

Avatar

Cristhian Boujon CristhianBoujon

View GitHub Profile
@CristhianBoujon
CristhianBoujon / gist:ffbb5c2ac7f861c8a65244398b11ff02
Created May 8, 2017 — forked from matoakley/gist:1092571
MySQL to convert a string into a slug
View gist:ffbb5c2ac7f861c8a65244398b11ff02
LOWER(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(TRIM('My String'), ':', ''), ')', ''), '(', ''), ',', ''), '\\', ''), '\/', ''), '\"', ''), '?', ''), '\'', ''), '&', ''), '!', ''), '.', ''), ' ', '-'), '--', '-'), '--', '-')) AS `post_name`