Stripping redundant whitespace -- whats wrong?
Posted: Wed Jul 08, 2009 1:59 pm
I have the following code:
All whitespace *except* that right at the start is being replaced with a single space why is the first not as well?
Code: Select all
$value = 't - his is a spaced line';
$value = preg_replace('#\s{2,}+#', ' ', $value);