我使用 ColdFusionSerializeJSON(queryname)
将我的查询结果转换为 json 格式并得到以下结果:
{
"COLUMNS":["ID","TAG","TAG_DESCRIPTION","TYPE"]
, "DATA": [1,"PHP","PHP is an open-source server-side scripting language widely used in web development.","programming"]
}
但我想要json这种格式,这是PHPjson_encode($rows)
返回的:
[ { "ID":"1"
, "0":"1"
, "tag":"php"
, "1":"php","type":"programming"
, "2":"programming"
, "tag_description":"PHP is an open-source server-side scripting language widely used in web development."
, "3":"PHP is an open-source server-side scripting language widely used in web development."
}
]
json_encode(PHP)
ColdFusion 中是否有替代品?还是我必须手动创建这种 json 格式?
谢谢