PHP - imap_8bit() 函式



PHP−IMAP 函式幫助您訪問電子郵件帳戶,IMAP 代表 **I**nternet **M**ail **A**ccess **P**rotocol,使用這些函式,您還可以使用 NNTP、POP3 協議和本地郵箱訪問方法。

imap_8bit() 函式接受一個表示 8 位字串的字串值作為引數,並將其轉換為可列印字串,用引號括起來並返回結果。

imap_binary() 函式 notranslate"> imap_8bit($str);

引數

序號 引數及描述
1

str (必填)

這是一個表示要轉換的 8 位字串的字串值。

返回值

此函式返回一個字串值,它是給定字串的 Quoted-Printable 格式。

PHP 版本

此函式首次在 PHP 版本 4 中引入,並在所有後續版本中可用。

示例

以下是 imap_8bit() 函式的示例:

<html>
   <body>
      <?php
         $str = "áéíóú";		 
         $result = imap_8bit($str);
         print($result);
      ?>
   </body>
</html>

輸出

這將生成以下輸出:

=C3=A1=C3=A9=C3=AD=C3=B3=C3=BA

示例

以下是上述函式的另一個示例:

<html>
   <body>
      <?php
         $str = "Alemán ąćęłńóśźż ĄĆĘŁŃÓŚŹŻ";		 
         $result = imap_8bit($str);
         print($result);
      ?>
   </body>
</html>

輸出

這將生成以下輸出:

Alem=C3=A1n =C4=85=C4=87=C4=99=C5=82=C5=84=C3=B3=C5=9B=C5=BA=C5=BC =C4=84= =C4=86=C4=98=C5=81=C5=83=C3=93=C5=9A=C5=B9=C5=BB
php_function_reference.htm
廣告