Return to Snippet

Revision: 49572
at July 25, 2011 17:40 by resting


Initial Code
function trim_whitespace($source)
  {
    $pattern = '/[^\w]\s*/';
    return preg_replace($pattern, ' ', $source);
  }

Initial URL

                                

Initial Description

                                

Initial Title
Regex Trim Whitespace

Initial Tags
regex

Initial Language
PHP