【发布时间】:2016-02-04 17:46:48
【问题描述】:
我正在尝试设置用户权限,它们作为数组存储在数据库中。这是我的 html 表单的当前输出...
{
"where_to_buy": "true",
"spec_sheet": "true",
"dwg_access": "true",
"bim_access": "true",
"product_prices": "true",
"portal_access": "true",
"save_quote": "true",
"request_drawings": "true",
"place_order": "true",
"special_offer": "true"
}
但是我需要这样格式化:
{
"where_to_buy": true,
"spec_sheet": true,
"dwg_access": true,
"bim_access": true,
"product_prices": true,
"portal_access": true,
"save_quote": true,
"request_drawings": true,
"place_order": true,
"special_offer": true
}
如何停止或将我的 html 表单提交从字符串转换为真值或假值?
【问题讨论】:
-
我不知何故错过了问题标题和文本之间的联系......
-
您已经将这些字符串作为字符串存储在数据库中了吗?请详细说明。
-
我把问题标题和别的东西搞混了,对不起!可以的话我会改的。