Revision: 4933
Updated Code
at February 5, 2008 16:47 by rafaelmt
Updated Code
function stripExcessSpaces($str) { return preg_replace('/\s\s+/', ' ', $str); } // ex.: $string = 'String with too many whitespaces.'; echo '<pre>'.$string." ".stripExcessSpaces($string).'</pre>';
Revision: 4932
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at January 29, 2008 20:21 by rafaelmt
Initial Code
function stripExcessSpaces($str) { return preg_replace('/\s\s+/', ' ', $str); } // ex.: $string = 'String with too many whitespaces.'; echo '<pre>'.$string." ".$string.'</pre>';
Initial URL
Initial Description
Remove excess whitespaces from string Remove espaços em branco em excesso de uma string
Initial Title
Remove excess whitespaces from string / Remove espaços em excesso de uma string
Initial Tags
regex, php
Initial Language
PHP