當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UTF8::encode_mimeheader方法代碼示例

本文整理匯總了PHP中UTF8::encode_mimeheader方法的典型用法代碼示例。如果您正苦於以下問題:PHP UTF8::encode_mimeheader方法的具體用法?PHP UTF8::encode_mimeheader怎麽用?PHP UTF8::encode_mimeheader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UTF8的用法示例。


在下文中一共展示了UTF8::encode_mimeheader方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: send_mail

 /**
  * Send mail
  * Replacement for mb_send_mail(), an UTF-8 friendly replacement for mail()
  */
 function send_mail($to, $subject, $message, $additional_headers = '', $additional_parameter = '')
 {
     $subject = UTF8::encode_mimeheader($subject);
     $message = chunk_split(base64_encode($message));
     $additional_headers = trim($additional_headers);
     if ($additional_headers != '') {
         $additional_headers .= "\n";
     }
     $additional_headers .= "Mime-Version: 1.0\n" . "Content-Type: text/plain; charset=UTF-8\n" . "Content-Transfer-Encoding: base64";
     if (ini_get('safe_mode')) {
         return @mail($to, $subject, $message, $additional_headers);
     } else {
         return @mail($to, $subject, $message, $additional_headers, $additional_parameter);
     }
 }
開發者ID:hatone,項目名稱:zenphoto-1.4.1.4,代碼行數:19,代碼來源:lib-utf8.php

示例2: send_mail

 /**
  * Send mail
  * Replacement for mb_send_mail(), an UTF-8 friendly replacement for mail()
  */
 static function send_mail($to, $subject, $message, $additional_headers = '', $additional_parameter = '', $html = false)
 {
     $subject = UTF8::encode_mimeheader($subject);
     $message = chunk_split(base64_encode($message));
     $additional_headers = trim($additional_headers);
     if ($additional_headers != '') {
         $additional_headers .= "\n";
     }
     $additional_headers .= "Mime-Version: 1.0\n" . "Content-Transfer-Encoding: base64\n";
     if ($html) {
         $additional_headers .= "Content-Type: text/html; charset=" . LOCAL_CHARSET;
     } else {
         $additional_headers .= "Content-Type: text/plain; charset=" . LOCAL_CHARSET;
     }
     if (SAFE_MODE) {
         return @mail($to, $subject, $message, $additional_headers);
     } else {
         return @mail($to, $subject, $message, $additional_headers, $additional_parameter);
     }
 }
開發者ID:ariep,項目名稱:ZenPhoto20-DEV,代碼行數:24,代碼來源:lib-utf8.php


注:本文中的UTF8::encode_mimeheader方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。