PHP中的Base64_encode()是否等于java.util.Base64? [英] Is Base64_encode() in PHP equal to java.util.Base64?
问题描述
我想使用php传递编码的字符串并将其传递给其他使用java.util.Base64
进行编码和解码的系统.
我可以使用base64_encode($str)
进行编码并将字符串传递给他们,以便在php和
我可以使用base62_decode($str)
来解码从php中的java.util.Base64
得到的内容吗?
还是有其他方法可以在php中编码和解码java.util.Base64
字符串?
I want to use php to pass and get a encoded string to other system which are using java.util.Base64
to encode and decode.
Can I use base64_encode($str)
to encode and pass the string to them for decode in php and
can i use base62_decode($str)
to decode what I get from java.util.Base64
in php?
Or is there other way to encode and decode java.util.Base64
string in php?
谢谢!
推荐答案
简短回答:是.
Base64是标准.
长答案:
The PHP documentation for base64_encode references RFC 2045 which is the MIME base64 encoding.
Javadoc 告诉您Java支持不同类型的Base64,其中之一是MIME.基本类型也应该起作用.主要区别在于MIME类型要求任何行都不能超过76个字符.
The Javadoc tells that Java supports different types of Base64, one of which is MIME. The Basic type should also work. The main difference is that the MIME type requires that no line is longer than 76 characters.
这篇关于PHP中的Base64_encode()是否等于java.util.Base64?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!