Posted By

gbot on 04/03/08


Tagged


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

gbot
ZiBoX
jamesming
nerdfiles


remove whitespace


 / Published in: PHP
 

  1. function remove_whitespace($string) {
  2.  
  3. $string = preg_replace('/\s+/', ' ', $string);
  4. $string = trim($string);
  5. return $string;
  6.  
  7. }

Report this snippet  

You need to login to post a comment.