qq_22630169
我林
采纳率100%
2015-09-02 02:52 阅读 8.7k

php字符串转换成json格式

这是字符串 {"id":"shunfeng","name":"顺丰快递","order":"023499317996","message":"","errcode":"0000","status":4,"data":[{"time":"2015-07-30 19:26:29","content":"顺丰速运 已收取快件"},{"time":"2015-07-30 21:08:57","content":"快件正转运至下一站"},{"time":"2015-07-30 21:46:10","content":"快件到达 【北京紫竹院集散中心】"},{"time":"2015-07-30 21:53:26","content":"快件正转运至下一站"},{"time":"2015-07-31 00:02:41","content":"快件到达 【北京首都机场集散中心2】"},{"time":"2015-07-31 00:06:18","content":"快件正转运至 【石家庄高开集散中心】"},{"time":"2015-07-31 07:50:01","content":"快件到达 【石家庄高开集散中心】"},{"time":"2015-07-31 09:21:55","content":"快件正转运至 【石家庄红旗服务点】"},{"time":"2015-07-31 11:06:08","content":"快件到达 【石家庄红旗服务点】"},{"time":"2015-07-31 11:13:46","content":"正在派送途中,请您准备签收(派件人:宋超,电话:13831156512)"},{"time":"2015-07-31 11:39:24","content":"已签收,感谢使用顺丰,期待再次为您服务"},{"time":"2015-07-31 11:39:24","content":"在官网"运单资料&签收图",可查看签收人信息"}]}

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

3条回答 默认 最新

  • 已采纳
    bdmh bdmh 2015-09-02 02:55

    如果你用php解析json,可以参考
    http://www.ruanyifeng.com/blog/2011/01/json_in_php.html
    如果你用java解析,java自己有JSONObject,或者用谷歌的gson

    点赞 评论 复制链接分享
  • ToBeTheBestman ToBeTheBestman 2015-09-02 03:01

    你这本身就是json格式啊

    点赞 评论 复制链接分享
  • qq_22630169 我林 2015-09-02 03:07

    用php转换成这样

      object(stdClass)#1 (5) {
      
        ["a"] => int(1)
        ["b"] => int(2)
        ["c"] => int(3)
        ["d"] => int(4)
        ["e"] => int(5)
      
      }
     

    点赞 评论 复制链接分享

相关推荐