因为我需要获取这个API的返回结果,写入数据库中.但是因为我是小白.不会取josn中需要的值,请各位大佬帮忙!
接口地址:https://api.oioweb.cn/api/ran...
返回结果:1. {
- "code": 1,
- "msg": "查询成功!",
- "data": {
- "360": {
- "img": "https://statics.aizhan.com/images/360/10.png",
- "weight": "10"
- },
- "br": {
- "img": "https://statics.aizhan.com/images/br/10.png",
- "weight": "10"
- },
- "mbr": {
- "img": "https://statics.aizhan.com/images/mbr/10.png",
- "weight": "10"
- },
- "sr": {
- "img": "https://statics.aizhan.com/images/sr/10.png",
- "weight": "10"
- },
- "msr": {
- "img": "https://statics.aizhan.com/images/msr/10.png",
- "weight": "10"
- },
- "m360": {
- "img": "https://statics.aizhan.com/images/m360/10.png",
- "weight": "10"
- },
- "sm": {
- "img": "https://statics.aizhan.com/images/sm/8.png",
- "weight": "8"
- }
- }
- }
我需要新建一个PHP文件获取其中的360、br、mbr、sr、msr、m360、sm中的weight显示的值。
这样该怎么写。谢谢!
未经过任何测试的代码,具体逻辑就是这个样子.