trim additional line breaks being added in email body from imap_open
You can remove all extra new lines by using preg_replace
.
preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $your_email_body);
You can remove all extra new lines by using preg_replace
.
preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $your_email_body);