Created
July 22, 2009 08:51
-
-
Save tonyarnold/151888 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /*** | |
| Method: encodeHeader | |
| Description: Encodes header | |
| Source: http://bitprison.net/php_mail_utf-8_subject_and_message | |
| More info: http://www.ietf.org/rfc/rfc2047.txt | |
| ***/ | |
| public static function encodeHeader($input, $charset='ISO-8859-1'){ | |
| // $separator = "?=".self::CRLF."=?{$charset}?B?"; | |
| // return "=?{$charset}?B?".wordwrap(base64_encode($input), 75-strlen($separator), $separator, true).'?='; | |
| return "=?{$charset}?B?" . base64_encode($input) . '?='; | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment