note 86764 added to function.quoted-printable-decode
| From: | andre at luyer dot nl | Date: | Sun, 02 Nov 2008 20:36:51 +0000 |
| Subject: | note 86764 added to function.quoted-printable-decode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-146064@lists.php.net to get a copy of this message | ||
A small update for Andrew's code below. This one leaves the original CRLF pairs intact (and
allowing the preg_replace to work as intended):
<?php
if (!function_exists("quoted_printable_encode")) {
/**
* Process a string to fit the requirements of RFC2045 section 6.7. Note that
* this works, but replaces more characters than the minimum set. For readability
* the spaces and CRLF pairs aren't encoded though.
*/
function quoted_printable_encode($string) {
return preg_replace('/[^\r\n]{73}[^=\r\n]{2}/', "$0=\r\n",
str_replace("%", "=", str_replace("%0D%0A", "\r\n",
str_replace("%20"," ",rawurlencode($string)))));
}
}
?>
Regards, André
----
Server IP: 213.249.64.162
Probable Submitter: 84.245.6.177
----
Manual Page -- http://www.php.net/manual/en/function.quoted-printable-decode.php
Edit -- https://master.php.net/note/edit/86764
Del: integrated -- https://master.php.net/note/delete/86764/integrated
Del: useless -- https://master.php.net/note/delete/86764/useless
Del: bad code -- https://master.php.net/note/delete/86764/bad+code
Del: spam -- https://master.php.net/note/delete/86764/spam
Del: non-english -- https://master.php.net/note/delete/86764/non-english
Del: in docs -- https://master.php.net/note/delete/86764/in+docs
Del: other reasons-- https://master.php.net/note/delete/86764
Reject -- https://master.php.net/note/reject/86764
Search -- https://master.php.net/manage/user-notes.php