您现在的位置是:URL安全的字符串base64编码和解码
URL安全的字符串base64编码和解码
// URL安全的字符串base64编码 function base64_encode_urlsafe($string) { $data = base64_encode($string); $data = str_replace(array('+', '/', '='), array('-', '_', ''), $data); return $data; } // URL安全的字符串base64解码 function base64_decode_urlsafe($string) { $data = str_replace(array('-', '_'), array('+', '/'), $string); $mod4 = strlen($data) % 4; if( $mod4 ) { $data .= substr('====', $mod4); } return base64_decode($data); }
站长简介
分类
最新文章
热门文章
- 微信支付退款结果通知解密
- 到ICANN投诉三五互联获取域名转移密码成功
- Linux修改密码提示passwd /usr/share/cracklib/pw_dict: error reading header
- {"errcode":45047,"errmsg":"out of response count limit hint]"}
- 微信html弹出点击右上角分享到朋友圈
- Apache禁用TRACE Method和添加X-frame-options响应头
- PHP将B转换为KB、MB、GB
- 构建微信公众号被动回复image图片消息xml
- mysqld_safe Number of processes running now
- CentOS使用chkconfig提示systemctl enable xxxx.service