Get rid of extra spaces using PHP's preg_replace


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. $str = preg_replace('/\s\s /', ' ', $str);
  3. ?>

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.