note 85926 added to function.quoted-printable-decode
| From: | ChristianAlbrecht at osu1 dot php dot net | Date: | Wed, 24 Sep 2008 22:10:25 +0000 |
| Subject: | note 85926 added to function.quoted-printable-decode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-144687@lists.php.net to get a copy of this message | ||
In Addition to david lionhead's function:
<?php
function quoted_printable_encode($txt) {
/* Make sure there are no %20 or similar */
$txt = rawurldecode($txt);
$tmp="";
$line="";
for ($i=0;$i<strlen($txt);$i++) {
if (($txt[$i]>='a' && $txt[$i]<='z') ||
($txt[$i]>='A' && $txt[$i]<='Z') || ($txt[$i]>='0'
&& $txt[$i]<='9')) {
$line.=$txt[$i];
if (strlen($line)>=75) {
$tmp.="$line=\n";
$line="";
}
}
else {
/* Important to differentiate this case from the above */
if (strlen($line)>=72) {
$tmp.="$line=\n";
$line="";
}
$line.="=".sprintf("%02X",ord($txt[$i]));
}
}
$tmp.="$line\n";
return $tmp;
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 91.46.212.58
----
Manual Page -- http://www.php.net/manual/en/function.quoted-printable-decode.php
Edit -- https://master.php.net/note/edit/85926
Del: integrated -- https://master.php.net/note/delete/85926/integrated
Del: useless -- https://master.php.net/note/delete/85926/useless
Del: bad code -- https://master.php.net/note/delete/85926/bad+code
Del: spam -- https://master.php.net/note/delete/85926/spam
Del: non-english -- https://master.php.net/note/delete/85926/non-english
Del: in docs -- https://master.php.net/note/delete/85926/in+docs
Del: other reasons-- https://master.php.net/note/delete/85926
Reject -- https://master.php.net/note/reject/85926
Search -- https://master.php.net/manage/user-notes.php