开发者

Help using json_encode to produce specific format

开发者 https://www.devze.com 2023-01-18 20:07 出处:网络
i want to use php\'s json_encode function to take data and produce the following format, but am struggling with it.

i want to use php's json_encode function to take data and produce the following format, but am struggling with it.

开发者_C百科

Can anyone advise if this can be done via json_encode()? Thanks for any help!

 data: [{
              x: 3,
              y: 0
           },
           {
              x: 10,
              y: 0
           }]
           },
           {
   data: [{
             x: 11,
             y: 0
           },
           {
             x: 13,
             y: 0
           }]
           },
            {
                data: [{
                    x: 12,
                    y: 1},
                {
                    x: 17,
                    y: 1}]}


http://codepad.org/6V0sWURY

0

精彩评论

暂无评论...
验证码 换一张
取 消