C# to PHP base64 encode/decode
程序员文章站
2022-05-05 10:41:13
...
We should probably URL Encode your Base64 string on the C# side before you send it.
And URL Decode it on the php side prior to base64 decoding it.
C# side
byte[] encbuff = System.Text.Encoding.UTF8.GetBytes("the string");
string enc = Convert.ToBase64String(encbuff);
string urlenc = Server.UrlEncode(enc);
and php side:
$data = $_REQUEST['in'];
$decdata = urldecode($data);
$raw = base64_decode($decdata);
推荐阅读
-
PHP保存Base64图片base64_decode的问题整理
-
浅析php中json_encode()和json_decode()
-
php中base64_decode与base64_encode加密解密函数实例
-
PHP保存Base64图片base64_decode的问题整理
-
php中json_decode()和json_encode()的使用方法
-
浅析PHP中json_encode与json_decode的区别
-
PHP保存Base64图片base64_decode的问题及解决办法
-
浅析php中json_encode()和json_decode()
-
php中base64_decode与base64_encode加密解密函数实例
-
php中对内置函数json_encode和json_decode的异常处理