encode_mime_header() static public method

See also: http://ca.php.net/manual/en/function.encode_mime_header.php
static public encode_mime_header ( $string ) : string
$string string Input MIME header to encode.
return string Encoded MIME header.
 /**
  * Encode a display name for proper inclusion with an email address.
  * @param $displayName string
  * @param $send boolean True to encode the results for sending
  * @return string
  */
 function encodeDisplayName($displayName, $send = false)
 {
     if (PKPString::regexp_match('!^[-A-Za-z0-9\\!#\\$%&\'\\*\\+\\/=\\?\\^_\\`\\{\\|\\}~]+$!', $displayName)) {
         return $displayName;
     }
     return '"' . ($send ? PKPString::encode_mime_header(str_replace(array('"', '\\'), '', $displayName)) : str_replace(array('"', '\\'), '', $displayName)) . '"';
 }