Skip to content

Instantly share code, notes, and snippets.

@tonyarnold
Created July 22, 2009 08:51
Show Gist options
  • Select an option

  • Save tonyarnold/151888 to your computer and use it in GitHub Desktop.

Select an option

Save tonyarnold/151888 to your computer and use it in GitHub Desktop.
<?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