Remove all whitespace


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

Removes all whitespace in a string.


Copy this code and paste it in your HTML
  1. $string = preg_replace('/\s+/', '', $string);

URL: http://stackoverflow.com/questions/2109325/how-to-strip-all-spaces-out-of-a-string-in-php

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.