Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Mikey Cawley
Added: Aug 8, 2018 11:18 PM
Views: 7
Tags: no tags
  1. function trimDoubleEOL($str, $nl = PHP_EOL) {
  2.     return preg_replace('`[' . $nl . $nl . ']+`', $nl, $str);
  3. }