基本介紹
函式定義,實例說明,例-1,例-2,
函式定義
string base64_decode ( string $encoded_data )
實例說明
例-1
使用base64_decode()函式對簡單字元串進行解碼。
<?php
$str = 'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw==';
echo base64_decode($str);
?>
此示例將顯示:
This is an encoded string
例-2
使用base64_encode()函式和base64_decode()函式對迅雷和FlashGet、QQ旋風地址進行互相轉化。
<?php
$txt1=trim($_POST['text1']);
$txt2=trim($_POST['text2']);
$txt3=trim($_POST['text3']);
$button=$_POST['button'];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title>迅雷和FlashGet,QQ旋風地址 地址轉換工具</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta content="迅雷,FlashGet,地址轉換," name="keywords">
</head>
<body>
<form name="form1" method="post" action="">
<hr size="1">
<h3>迅雷轉換</h3>
<P>轉換地址:
<input name="text1" value="<?php echo $txt1;?>" type="text" style="width:516px;" /></P>