note 74145 added to function.imap-qprint

From: Date: Tue, 27 Mar 2007 14:35:19 +0000
Subject: note 74145 added to function.imap-qprint
Groups: php.notes 
Request: Send a blank email to php-notes+get-124849@lists.php.net to get a copy of this message
If you don't have access to the imap_qprint function and you have to encode URL Decoded and Quoted Printable Strings you receive by Mail try this simple function. But if you don't receive URL Decoded data and the string doesn't contain an = you better use http://www.php.net/manual/en/function.quoted-printable-decode.php function decode_qprint($str){ $arr= array("A","B","C","D","E","F"); while (list(, $var) = each($arr)) { $i=0; while ($i <=9){ $str=str_replace("=".$var.$i,"%".$var.$i,$str); $i++;} $arr2 = array("A","B","C","D","E","F"); while (list(, $val) = each($arr2)) { $str=str_replace("=".$var.$val,"%".$var.$val,$str);}} $str = urldecode($str); $str = utf8_encode($str); return $str;} $s2d='=F6=D6=DF=C4=E4=DC=FC=A9=AE'; $2s2d='%F6'; $output = decode_qprint($s2d); $output2 = decode_qprint($2s2d); echo $output; echo $output2; ---- Server IP: 69.147.83.197 Probable Submitter: 193.111.216.132 (proxied: 10.1.14.85, 127.0.0.1) ---- Manual Page -- http://www.php.net/manual/en/function.imap-qprint.php Edit -- https://master.php.net/note/edit/74145 Del: integrated -- https://master.php.net/note/delete/74145/integrated Del: useless -- https://master.php.net/note/delete/74145/useless Del: bad code -- https://master.php.net/note/delete/74145/bad+code Del: spam -- https://master.php.net/note/delete/74145/spam Del: non-english -- https://master.php.net/note/delete/74145/non-english Del: in docs -- https://master.php.net/note/delete/74145/in+docs Del: other reasons-- https://master.php.net/note/delete/74145 Reject -- https://master.php.net/note/reject/74145 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#124849) next »