phpurl编码与解码(加密/解密)
时间:2021-07-01 10:21:17
帮助过:16人阅读
- function base64_url_encode($input) {
- return rtrim(strtr(base64_encode($input), '+/', '-'), '=');
- }
- $code_urlfile = 'test1/test2/1234';
- echo base64_url_encode($code_urlfile);
- echo '
'; // bbs.it-home.org - $url = base64_url_encode($code_urlfile);
- echo base64_decode($url);
- ?>
结果:
dGVzdDEvdGVzdDIvMTIzNA
test1/test2/1234 |