note 52706 added to function.imap-8bit
| From: | nick at plumdigitalmedia dot com | Date: | Tue, 10 May 2005 15:15:11 +0000 |
| Subject: | note 52706 added to function.imap-8bit | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-89212@lists.php.net to get a copy of this message | ||
This function appears to wrap lines in the middle of words, not just at whitespace, which upsets
some versions of Outlook Express when used to format email body text. We've had more luck with
this function:
<?
function quoted_printable($string)
{
$crlf = "\n" ;
$string = preg_replace('!(\r\n|\r|\n)!', $crlf, $string) . $crlf ;
$f[] = '/([\000-\010\013\014\016-\037\075\177-\377])/e' ;
$r[] = "'=' . sprintf('%02X', ord('\\1'))" ;
$f[] = '/([\011\040])' . $crlf . '/e' ;
$r[] = "'=' . sprintf('%02X', ord('\\1')) .
'" . $crlf . "'" ;
$string = preg_replace($f, $r, $string) ;
return trim(wordwrap($string, 70, ' =' . $crlf)) ;
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.imap-8bit.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52706
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52706&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52706&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52706&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52706&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52706&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52706&report=yes
Search -- http://master.php.net/manage/user-notes.php