Whoooop.co.uk

Removing White Space

by John on Mar.24, 2005, under PHP, Snippets

1111670088

Quick Snippet to remove all the white space from a string.


< ?php
$string = "mary had a monkey called Booboo ";
$text = preg_replace("/(\s)/", "", $string);
?>

Related Posts

:, ,

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!