-2
我想知道如何在json文件數組中添加新數據如何在PHP中添加json數組中的數據?
我是json的新手。
想要添加來自php或html輸入的數據。
[
{
"id":1,
"name":"abc",
"value":"abcd"
},
{
"id":2,
"name":"Kiss",
"value":"Kiss"
}
{
"id":3,
"name":"efgh",
"value":"efgh"
}
]
如何添加第四陣列的項目在JSON文件,PHP或HTML輸入
請幫我舉例來說,
感謝
如何解碼,修改數組,然後編碼回來? – Fabio
看看這個問題,可能是重複的:http://stackoverflow.com/questions/1745052/add-new-data-into-php-json-string –
[我已經在這裏發佈回答你的問題] http:// stackoverflow .com/questions/3921520/writing-json-object-to-json-file-on-server/39091183#39091183 –