quoted_printable_encode()
quoted_printable_encode() — Convert a 8 bit string to a quoted-printable string.
Built-in function of PHP 8.5. The manual lists it as available in PHP 5 >= 5.3.0, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.
What it does
Returns a quoted printable string created according to RFC2045, section 6.7.
Signature
quoted_printable_encode(string $string): string
Parameters
| Parameter | Type | What it takes |
|---|---|---|
| $string | string | The input string. |
Return value
Returns the encoded string.
Example
A runnable snippet:
$encoded = quoted_printable_encode('Möchten Sie ein paar Äpfel?'); var_dump($encoded); var_dump(quoted_printable_decode($encoded));
Output:
string(37) "M=C3=B6chten Sie ein paar =C3=84pfel?" string(29) "Möchten Sie ein paar Äpfel?"
See also
quoted_printable_decode(), iconv_mime_encode()
All PHP 8.5 built-in functions
Reference card built from the PHP manual page quoted_printable_encode() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.