★ wanayoo — archive 1999 http://fr.php.net/manual/cs/function.base64-decode.phpNouvelle recherche | Portail wanayoo
PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
previousURLsbase64_encodenext
Last updated: Thu, 21 Nov 2002
view the printer friendly version or the printer friendly version with notes or change language to English | Brazilian Portuguese | Finnish | French | German | Hungarian | Italian | Japanese | Korean | Polish | Romanian | Russian | Slovak | Spanish | Swedish | Turkish

base64_decode

(PHP 3, PHP 4 )

base64_decode -- Dekódovat data kódovaná pomocí MIME base64

Popis

string 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
add a note about notes
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.

add a note about notes
previousURLsbase64_encodenext
Last updated: Thu, 21 Nov 2002
show source | credits | stats | mirror sites
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by: nexen.net
Last updated: Wed Dec 4 04:11:43 2002 CET