-1
我想在一個字符串像下面序列化的模型: -如何爲特定字符串執行JSON反序列化?
"{"name":"firstName","value":"john"}",
之後,我想反序列化string.And它應該是接近這樣的:
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
僅供參考,我們可以得到上面的JSON字符串,如果我們這樣做的JavaScript: -
JSON.stringify(form.serializeArray())
但我需要的是產生它的服務器side.Can任何一個建議我最好的它的方式?
,我沒有序列化字符串如above.What我想的是,我有一個模型類,我想序列化類爲上面的字符串format.And後想要獲得像你提到的反序列化對象。 – Pawan
@Pawan我只是更新我的答案 –
,謝謝我檢查它。 – Pawan