双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

我想问下java与php之间的关系

bing15 bing15 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
在java中JSONObject与php的json有什么区别吗?
先放一个例子讨论下:


public static void main(String[] argv) throws Exception {
//调用充值接口
String application_value = "recharge";
String account = "payease";
String mobile = "13581570818";
String orderid = "201305133127";
String amount = "100";
JSONObject jobj = new JSONObject();
jobj.accumulate("application_value", application_value);
jobj.accumulate("account", account);
jobj.accumulate("mobile", mobile);
jobj.accumulate("amount", amount);
jobj.accumulate("orderid", orderid);
String s = java.net.URLEncoder.encode(UserJsonUtil.encryptJsonUser(jobj));//UserJsonUtil.encryptJsonUser加密方法
System.out.println( "res=="+s);


如上的例子,如果要在php中要怎样实现?
在php中仅能用json的函数只有编码(json_encode)和解码(json_decode);
还有那个加密加的是什么?是一个对象吗?我对java不了解,还请高手支招。
...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部
bing15
Java EE 67,535 成员 225,843 内容