How do I remove multiple blank lines from a string. I have looked at the examples on stackoverflow and have tried to change my code accordingly but I am not getting the rig
also put a trim on it:
function removeMultipleBlankLines(&$array) { return trim(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $array)); }