【发布时间】:2014-04-29 11:29:07
【问题描述】:
我想在字符串中序列化模型,如下所示:-
"{"name":"firstName","value":"john"}",
然后我想反序列化该字符串。它应该可以像这样访问:
returnString[0]["name"] //here name is the name of the property and returnString is the serialized string.
returnString[0]["value"] //here value is the value of the field
仅供参考,如果我们用 javascript 做这样的事情,我们可以得到上面的 JSON 字符串:-
JSON.stringify(form.serializeArray())
但我需要在服务器端生成它。有人可以建议我最好的方法吗?
【问题讨论】: