PHP string cleaner

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.


Previous Post ES-6 JavaScript to do list web application
Next Post How to avoid bad WordPress development practices
Comments (0)



Leave a Reply

Your email address will not be published. Required fields are marked *