|
|
 |
base64_decode (PHP 3, PHP 4 ) base64_decode -- Dekódovat data kódovaná pomocí MIME base64 Popisstring base64_decode ( string encoded_data)
base64_decode() dekóduje
encoded_data a vrátí původní data. Vrácená
data mohou být binární
Viz také: base64_encode(), RFC 2045 sekce 6.8.
User Contributed Notes base64_decode |
 |
nsayer at kfu dot com
21-Mar-2002 08:15 |
|
I used to do uudecode as a C module, but I've discovered a really fast way
to do it in PHP. Here it is:
function uudecode($encode) {
$b64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZ\ abcdefghijklmnopqrstuvwxyz0123456789+/";
$encode = preg_replace("/^./m","",$encode);
$encode = preg_replace("/\n/m","",$encode);
for($i=0; $i<strlen($encode); $i++) { if ($encode[$i] ==
'`') $encode[$i] = ' '; $encode[$i] =
$b64chars[ord($encode[$i])-32]; }
while(strlen($encode) %
4) $encode .= "=";
return
base64_decode($encode); }
This is the PHP equivalent to perl's
unpack("u",___). That is, you need to strip the 'begin' and
'end' lines from the typical uuencoded file.
|
|
 |
| |