note 13958 added to function.mail.php
| From: | bkw at weisshuhn dot de | Date: | Wed, 11 Jul 2001 13:59:49 +0000 |
| Subject: | note 13958 added to function.mail.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-15237@lists.php.net to get a copy of this message | ||
To use iso-8859-1 Characters in the subject, use this function to escape them properly. (Seperate
the underscores for spaces).
function escape_subject($instring) {
__if (preg_match('/[\x00-\x1f\x7f-\xff]/',$instring)) {
____return '=?iso-8859-1?Q?' . preg_replace(
______'/([\x00-\x20\x7f-\xff\x3d\x3f])/e',
______'sprintf("=%X",ord("\1"))',
______$instring
____) . '?=';
__}
__return $instring; // No Umlauts
}
http://www.php.net/manual/en/function.mail.php