Here is my Json. This ia an dwr response ( a webservice created in java) .
{
key1 : {
date : "Today" ,
items : [
{
itemKey1 : "itemValue1",
itemKey2 : "itemValue2",
},
{
itemKey1 : "itemValue1",
itemKey2 : "itemValue2",
},
]
}
}
JSON LINT is also showing the error.
If you can see key do not have "" may be that's why i can not parse it to json in php directly. Is there any way oi can parse it to json and then to array or directly to an array.
But when i transfor this to this type of json it. In JSON LINT it shows that it is proper json.
{
"key1": {
"date": "Today",
"items": [
{
"itemKey1": "itemValue1",
"itemKey2": "itemValue2"
},
{
"itemKey1": "itemValue1",
"itemKey2": "itemValue2"
}
]
}
}
So is there anyway i can trasnfer json to second type. Dynamically in PHP