Home  >  Article  >  Backend Development  >  Base64在线编码解码实现代码 演示与下载_php实例

Base64在线编码解码实现代码 演示与下载_php实例

WBOY
WBOYOriginal
2016-05-17 09:21:411337browse

在线演示地址:
gb2312版本 http://tools.jb51.net/tools/base64_decode-gb2312.php
utf8版本 http://tools.jb51.net/tools/base64_decode-utf8.php

复制代码 代码如下:

header('Content-Type: text/html; charset=gb2312');
$txt1 = stripslashes(trim( @$_POST['text1']));
$button = @$_POST['button'];
$down = @trim($_GET['down']);
if ($down==1) {
header("Content-type: command");
header("Content-Disposition: attachment; filename=base64_decode.txt");
$contents = file_get_contents(basename($_SERVER['PHP_SELF']));
echo $contents;
exit;
}
?>



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn