-3
我想用PHP构建一个json对象。 JSON对象必须是这样的(用于创建一个谷歌的折线图):使用重复键创建json数据
{"cols":[{"id":"bingo","label":"bingo","type":"string"},{"id":"value","label":"value","type":"number"}],"rows":[{"c":[{"v":"date1"},{"v":151}]},{"c":[{"v":"date2"},{"v":102}]},{"c":[{"v":"date3"},{"v":52}]},{"c":[{"v":"date4"},{"v":32}]},{"c":[{"v":"date5"},{"v":7}]},{"c":[{"v":"date5"},{"v":7}]},{"c":[{"v":"date5"},{"v":7}]}]}
我有一个问题,创建以下部分:
{"c":[{"v":"date3"},{"v":52}]},{"c":[{"v":"date4"},{"v":32}]},{"c":[{"v":"date5"},{"v":7}]},{"c":[{"v":"date5"},{"v":7}]},{"c":[{"v":"date5"},{"v":7}]}
如何创建这个用PHP?
你有什么问题创建它?你的原始数据是什么样的? –