duanbiao4035 2015-10-29 12:06
浏览 89

PHP的Web服务[关闭]

i am new for webservice.

i want to out put like below...

"id": "11",
"cid": "12",
"cat_name": "aaaaaa",
"name": "ssaa16",
"image_path_big": "http:\/\/aaa.com\/images\/product\/ww44_533345b.jpg",
"image_path_thumb": "http:\/\/aaa.com\/images\/product\/thumb\/ww44_533345b.jpg",
"size": 
    [
        {"size": "4"},
        {"size": "3"},
        {"size": "5"},
        {"size": "2"}
    ],
"priceChart":
    [
        {
        "finish": "sss",
        "price":
            [
                {"finish": "55"},
                {"finish": "11"},
                {"finish": "12"},
                {"finish": "10"},
                {"finish": "15"}
            ]
        },
        {
        "finish": "ddd",
        "price":
            [
                {"finish": "55"},
                {"finish": "11"},
                {"finish": "12"},
                {"finish": "10"},
                {"finish": "15"}
            ]
        }
    ],
    "isN": "0"
}

So how can i get this type of format using json, php and mysql.

i have no more idea about webservices

Thanks in advance

  • 写回答

1条回答 默认 最新

  • dsdzvprlp51692469 2015-10-29 12:45
    关注

    Create an array in PHP, then use json_encode() PHP method. See the manual

    评论

报告相同问题?

悬赏问题

  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据