SyntaxFix
Write A Post
Hire A Developer
Questions
preg_replace('/(\s\s+|\t|\n)/', ' ', $row['message']);
This replaces all tabs, all newlines and all combinations of multiple spaces, tabs and newlines with a single space.