bettermousetraps.net
Knowledge Base
PHP Knowledge Base
PHP Knowledge Base
Regular Expressions
Delete Blank Lines from Text
Code
preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $string);