- Get link
- X
- Other Apps
base64_encode and base64_decode:
(PHP 4, PHP 5, PHP 7)
base64_encode — Encodes data with MIME base64
Syntax:
string base64_encode
( string
$data
)
Encodes the given
data
with base64.
Example:
<?php$str = 'eabhyas.blogspot.com';
echo base64_encode($str);
?>
Output:
ZWFiaHlhcy5ibG9nc3BvdC5jb20=
(PHP 4, PHP 5, PHP 7)
base64_decode — Decodes data encoded with MIME base64
Syntax:
string base64_decode
( string
$data
[, bool $strict
= false
] )
Decodes a base64 encoded
data
.
Example:
<?php$str = 'ZWFiaHlhcy5ibG9nc3BvdC5jb20=';
echo base64_decode($str);
?>
Output:
eabhyas.blogspot.com
Function:
<?
function sscb64ende($s,$t=0){
if($t==0){
$v=base64_encode($s);
$v = strtr($v, '+/=', '-_,');
} else {
$v = strtr($s, '-_,', '+/=');
$v=base64_decode($v);
}
return $v;
}
?>
function sscb64ende($s,$t=0){
if($t==0){
$v=base64_encode($s);
$v = strtr($v, '+/=', '-_,');
} else {
$v = strtr($s, '-_,', '+/=');
$v=base64_decode($v);
}
return $v;
}
?>
Comments
Post a Comment