I have the following string which I want to 'clean' from multiple whitespaces:
$string = "This is a test string"; //Using utf8_decode
Not a big deal right? However, the string is not 'cleaned' after using:
$string = preg_replace('/\s+/', ' ', $string);
Because, the string actually is like this:
$test = "This is a  test string";
So, how can I fix this issue?
Thanks.
Please, I don't want to replace the  character like str_replace('Â', '')
or something