-
- 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 |