I am looking for something like trim() but for within the bounds of a string. Users sometimes put 2, 3, 4, or more line returns after they type, I need to sanitize this inp
function str_squeeze($body) { return preg_replace("/\n\n+/", "\n\n", $body); }