Posted By

annalog on 11/17/09


Tagged

pregreplace


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

guillermoj88gmailcom


Get rid of extra spaces using PHP's preg_replace


 / Published in: PHP
 

URL: http://agaric.com/note/get-rid-extra-spaces-using-phps-preg-replace

  1. <?php
  2. $str = preg_replace('/\s\s /', ' ', $str);
  3. ?>

Report this snippet  

You need to login to post a comment.