Home > Article > Backend Development > What should I do if I decode garbled characters after PHP base64 encoding?
The solution to decoding garbled characters after PHP base64 encoding: When passing in GET form, just prevent the [ ] sign from being replaced with a space. The code is [$str = base64_decode(str_replace(" "," ",$ _GET['str']))].
##Solution to decoding garbled characters after PHP base64 encoding:
Sometimes usebase64_encode After encryption, it is transmitted to other pages in the form of GET. When decrypted with
base64_decode, garbled characters appear.
When passed in the form of GET,
will be replaced with spaces
.
$str = base64_decode(str_replace(" ","+",$_GET['str']));
Related learning recommendations:
The above is the detailed content of What should I do if I decode garbled characters after PHP base64 encoding?. For more information, please follow other related articles on the PHP Chinese website!