Convert Multiple Spaces To a Single Space
Sometimes you want to sanitise a block of text or input by removing consecutive multiple whitespace entries from it, replacing them with a single space. This php code will allow you to do just that:
$message = preg_replace(‘/ss+/’, ‘ ‘, $message);
Related posts on coderchris.com:
- Styling the The TinyMCE Text Area
They guys who produce TinyMCE suggest, when initialising the editor, that you set the content_css... - MySQL 5.1 multiple tmpdirs and incorrect key file for table errors
Well I found out a few new things today... Firstly if you see an error... - Make Money With Wordpress And Matched.co.uk
Everybody out there at the moment is trying to make money from their blog in... - Where Did All The Disk Space Go??
When I converted my laptop to a dual boot system, I did so by shrinking... - How to filter user submitted data easily in PHP?
How to filter user submitted data easily in PHP? Posted using ShareThis Firstly, as you...
Categories: Uncategorized

Also Find Me On