1 2 <? 3 $text = preg_replace('/\s+/', ' ', $text); 4 ?>
Strip whitespace (or other characters) from the beginning and end of a string
1 $variable = trim($variable);
13402 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
1 2 <? 3 $text = preg_replace('/\s+/', ' ', $text); 4 ?>
1 $variable = trim($variable);
You need to create an account or log in to post comments to this site.