开源第1天-PHP-自动解析json生成php类文件,自动映射json到php对象
业务中经常需要对接第三方服务,常用的对接方式就是使用 http json 接口,有些 json 格式较为复杂,使用php数组进行数据交互非常麻烦,非常容易出错。$responseStr = '{"foo":"bar", "hello":"world"}';$responseArr = json_decode($responseStr, true);if($responseArr["fooo"] == "foobar") { // do sth.}现在 IDE 比如 PHPStorm 也不
原创
2021-09-18 00:30:19 ·
358 阅读 ·
0 评论