note 127304 added to function.base64-decode

From: Date: Tue, 19 Jul 2022 13:51:40 +0000
Subject: note 127304 added to function.base64-decode
Groups: php.notes 
Request: Send a blank email to php-notes+get-219035@lists.php.net to get a copy of this message
funny things are inside these lines so pay attention carefully: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="Generator" content="Custa"> <style>b{color:red}</style> <title></title> </head> <body> </body> </html><?php function say($str){ var_dump($str); echo '<hr>'; } /*assuming you encode a string in MIME base64*/ $encoded=base64_encode('Hello PHP!'); say('Hello PHP! ... <b>'.$encoded.'</b>'); /*you know is possible to see the decoded value with:*/ say('Decoded: <b>'.$encoded.'</b> ... <b>'.base64_decode($encoded).'</b>'); /* THERE ARE SEVERAL OTHERS METHODS TO DECODE THE STRING : */ say(readfile("data://text/plain;base64,{$encoded}")); say(file("data://text/plain;base64,{$encoded}")[0]); $fp = @fopen("data://text/plain;base64,{$encoded}", "r"); if ($fp) { while (($buffer = fgets($fp, 4096)) !== false) { say( $buffer ); } fclose($fp); } ?> ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.5.135 (proxied: 5.14.135.214) ---- Manual Page -- https://php.net/manual/en/function.base64-decode.php Edit -- https://main.php.net/note/edit/127304 Del: integrated -- https://main.php.net/note/delete/127304/integrated Del: useless -- https://main.php.net/note/delete/127304/useless Del: bad code -- https://main.php.net/note/delete/127304/bad+code Del: spam -- https://main.php.net/note/delete/127304/spam Del: non-english -- https://main.php.net/note/delete/127304/non-english Del: in docs -- https://main.php.net/note/delete/127304/in+docs Del: other reasons-- https://main.php.net/note/delete/127304 Reject -- https://main.php.net/note/reject/127304 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#219035) next »