
PHP string cleaner
This example uses two regular expressions to strip the inserted string of all symbols, extra hyphens and extra white spaces so the end result is a clean text structure that contains lowercase words, and only one hyphen between each word. This has many use-case scenarios, for example, you can use it in a custom CMS for inserting clean SEO friendly blog titles, or url-s, based on the text that the author inserts in the input field.
Comments (0)