Source Code:
(back to article)
<?php $string = "This is a string with excess whitespace."; $string = preg_replace('/\s+/', ' ', $string); echo $string;
Result:
Report an issue