note 76645 added to function.quoted-printable-decode
| From: | roelof at osu1 dot php dot net | Date: | Tue, 24 Jul 2007 14:06:29 +0000 |
| Subject: | note 76645 added to function.quoted-printable-decode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-128884@lists.php.net to get a copy of this message | ||
I modified the below version of legolas558 at users dot sausafe dot net and added a wrapping option.
<?php
/**
* Codeer een String naar zogenaamde 'quoted printable'. Dit type van coderen wordt
* gebruikt om de content van 8 bit e-mail berichten als 7 bits te versturen.
*
* @access public
* @param string $str De String die we coderen
* @param bool $wrap Voeg linebreaks toe na 74 tekens?
* @return string
*/
function quoted_printable_encode($str, $wrap=true)
{
$return = '';
$iL = strlen($str);
for($i=0; $i<$iL; $i++)
{
$char = $str[$i];
if(ctype_print($char) && !ctype_punct($char)) $return .= $char;
else $return .= sprintf('=%02X', ord($char));
}
return ($wrap === true)
? wordwrap($return, 74, " =\n")
: $return;
}
?>
----
Server IP: 194.109.193.76
Probable Submitter: 82.93.140.40
----
Manual Page -- http://www.php.net/manual/en/function.quoted-printable-decode.php
Edit -- https://master.php.net/note/edit/76645
Del: integrated -- https://master.php.net/note/delete/76645/integrated
Del: useless -- https://master.php.net/note/delete/76645/useless
Del: bad code -- https://master.php.net/note/delete/76645/bad+code
Del: spam -- https://master.php.net/note/delete/76645/spam
Del: non-english -- https://master.php.net/note/delete/76645/non-english
Del: in docs -- https://master.php.net/note/delete/76645/in+docs
Del: other reasons-- https://master.php.net/note/delete/76645
Reject -- https://master.php.net/note/reject/76645
Search -- https://master.php.net/manage/user-notes.php