all spaces become single spaces regex


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



Copy this code and paste it in your HTML
  1. $test = '23 124 124 4 2 21 4 142 lajdlkajsldkajs jasd 124 what great data t a a';
  2. $test = preg_replace( '([\ ])', ' ', $test );
  3. echo $test;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.