How to use the regular expression to display text from the database and, at the same time, wherever there are more than 2 line breaks in a row, remove the rest after 2x?
Here's how here - I press Enter 10 times in a row, anyway, the text will be displayed like this:
Only 1 blank line.
preg_replace('~(\R)+~', '$1', $input);, well, orpreg_replace('~\R{2,}~', '<br />', $input);. - Wiktor Stribiżew