Unclassified NewsBoard Code Reference

quoted_printable_encode function

Complement to PHP's quoted_printable_decode()

function quoted_printable_encode ($str, $level = 1, $splitlines = true);

Parameters:

str
(string) data to encode
level  –  optional, default: 1
(int) supports multiple levels of encoding characters:
1: \x01-\x08 \x0A-\x1F \x3D \x7F-\xFF
2: \x01-\x08 \x0A-\x1F SPC->_ \x21-\x24 \x3C-\x40 \x5B-\x60 \x7B-\xFF
3: \x01-\x08 \x0A-\x1F SPC->_ \x21-\x2F \x3A-\x40 \x5B-\x60 \x7B-\xFF
splitlines  –  optional, default: true
(bool) split long lines at 76 characters (default)

Remarks:

NOTE: Quoted-printable encoding as done here is NOT BINARY SAFE! use base64_encode() instead.

1) performs a simple encoding suitable for most text body applications
2) is needed for 'encoded-word's, header values or some more special applications
3) only lets digits (0...9) and letters (A...Z, a...z) in plain text

Implementation file: unb_lib/mime.lib.php, line 28

© 2006 Yves Goergen. Unclassified NewsBoard Homepage. Reference based on UNB unb.devel.20060128, dated 2006-01-28.