首頁  >  文章  >  後端開發  >  C# 到 PHP base64 編碼/解碼

C# 到 PHP base64 編碼/解碼

WBOY
WBOY原創
2016-08-08 09:26:551113瀏覽

http://stackoverflow.com/questions/257462/c-sharp-to-php-base64-encode-decode

網址 Enefshsideshside line it.

And URL Decode it on the php side prior to base64 decoding it.

C# side

<code>byte[] encbuff = System.Text.Encoding.UTF8.GetBytes("the string");
string enc = Convert.ToBase64String(encbuff);
string urlenc = Server.UrlEncode(enc);
</code>

and php side:

<code>$data = $_REQUEST['in'];
$decdata = urldecode($data);
$raw = base64_decode($decdata);
</code>

以上就介紹了C# to PHP base64 encode/decode,包含了方面的內容,希望對PHP教程有興趣的朋友有幫助。

🎜
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn