Q:

Remove multiple whitespaces - PHP doesn't find the spaces

I know, there is a lot of similar questions, and you will says, is a duplicate, but I can't find the solution!
I need to remove multiple white spaces and only write one space. In my code I wrote 'REPLACE' instead of ' ', just to clarify. This is some code that I have tested and is not working:
$string=$data['post_content'];
$filtered1=preg_replace("/[^\S\r\n]+/",'REPLACE',$string);
$filtered2=preg_replace("#[^\S\r\n]+#",'REPLACE',$string);
$filtered3=preg_replace("#[^\S\r\n][^\S\r\n]+#",'REPLACE',$string);
$filtered4=preg_replace('#[^\S\r\n][^\S\r\n]+#','REPLACE',$string);
$filtered5=preg_replace('#!\s+!#', 'REPLACE', $string);
$filtered6=preg_replace("/(?<=\s)\x20|\x20(?=\s)/", "REPLACE", $string);
$filtered7=preg_replace("/([\s])\1+/", "REPLACE", $string);
$filtered8=preg_replace("#[^\S\r\n][^\S\r\n]#",'REPLACE',$string);
$filtered9=preg_replace("'/\s+/'",'REPLACE',$string);
$testing1=str_replace("  ","REPLACE",$string);
$testing2=str_replace("\s",'REPLACE',$string);
$testing3=str_replace(array('  '),'REPLACE',$string);
$testing4=str_replace('  ',"REPLACE",$string);
$testing5=str_replace("  ","REPLACE",$string);
$testing6=str_replace(array("  "),'REPLACE',$string);
$testing7=str_replace(array("\s\s"),'REPLACE',$string);

This is the string test: 

this is a test 1   2   3     4     6      end

And the results were for $filtered1 and $filtered2:

thisREPLACEisREPLACEaREPLACEtestREPLACE1  REPLACE2  REPLACE3    REPLACE4    REPLACE6     REPLACEend.

For all the others, the result was:

this is a test 1   2   3     4     6      end

Is like PHP is not finding the spaces, even with explode is not finding the double spaces "  ". I'm using PHP 5.5.1

A:

The problem wasn't the RegEx, the problem was the modifier, I used the modifier u thanks to Aurimas answer. These are the possible solutions:
$filtered1=preg_replace("/[^\S\r\n]+/u",' ',$string);
$filtered2=preg_replace("#[^\S\r\n]+#u",' ',$string);
$filtered3=preg_replace("#[^\S\r\n][^\S\r\n]+#u",' ',$string);
$filtered10=preg_replace('/[^\S\r\n]{2,}/u',' ',$string);0
$filtered11=preg_replace('/\h+/u', ' ', $string);
$filtered16=preg_replace('/(\xA0+)/u', ' ', $string);

