I\'m developing a single serving site in PHP that simply displays messages that are posted by visitors (ideally surrounding the topic of the website). Anyone can post up to
Something like
preg_replace('/(\r|\n|\r\n){2,}/', '', $text);
should work, I think. Though I don't remember PHP syntax exactly, it might need some more escaping :-/