When I try to remove multiple spaces from a string by using this code
preg_replace('/\s{2,}/', ' ', $data)
I notice that also line breaks are removed.
When I use a space character in the syntax instead of a \s, then everything works normally.
So I'm wondering why do we have this behavior and what is happening?