quoted_printable_encode

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

quoted_printable_encode将 8-bit 字符串转换成 quoted-printable 字符串

说明

quoted_printable_encode(string $string): string

返回 quoted-printable 格式的字符,该格式由 » RFC2045 6.7.章节里制定。

该函数与 imap_8bit() 函数十分相似,不同的是该函数不需要 IMAP 模块就能运行。

参数

string

输入的字符串。

返回值

返回编码之后的字符串。

范例

示例 #1 quoted_printable_encode() 示例

<?php

$encoded
= quoted_printable_encode('Möchten Sie ein paar Äpfel?');

var_dump($encoded);
var_dump(quoted_printable_decode($encoded));
?>

以上例程会输出:

string(37) "M=C3=B6chten Sie ein paar =C3=84pfel?"
string(29) "Möchten Sie ein paar Äpfel?"

参见

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top