Chinaunix

标题: php中的json数据,如何转成通过“&”连接的url格式 [打印本页]

作者: linlone    时间: 2015-09-17 15:39
标题: php中的json数据,如何转成通过“&”连接的url格式
比如json数据:
  1. {
  2. a:1;
  3. b:中国;
  4. c:"hello"
  5. }
复制代码
转成url格式:a=1&b=中国&c=hello


作者: bikong0411    时间: 2015-09-20 17:42
  1. http_build_query(json_decode($str,TRUE));
复制代码

作者: shang2010    时间: 2015-09-27 08:21
想法不错,是不是太懒了你

作者: shang2010    时间: 2015-09-27 08:22
想起以前公司一些同事,领导让做个字串替换代码,研发楞是一个多星期没声音




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2