更新时间:2023-02-11 11:18:21
因此在javascript中(使用URI编码进行了更新):
So in javascript (updated with encoding URI):
var myStr = "I am the string to encode";
var token = encodeURIComponent(window.btoa(myStr));
然后您应该能够将该base64编码的字符串添加到您的get请求中.
You should be then able to add that base64 encoded string to your get request.
然后在PHP中,检索请求后:
Then in PHP, after you retrieve the request:
<?php
$str = 'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw==';
echo base64_decode(urldecode($str));
?>