I have this json string and want to decode it and use it. But below the print result is empty.
$data = '{"Category":
06-30 16:23:52.198: I/s(23262): [{"class":"ir.aiga.apps.datastore.db.CategoryModel","id":1,"name":"علی"},{"class":"ir.aiga.apps.datastore.db.CategoryModel","id":2,"name":"گ"},{"class":"ir.aiga.apps.datastore.db.CategoryModel","id":3,"name":"علی"},{"class":"ir.aiga.apps.datastore.db.CategoryModel","id":4,"name":"ولی"},{"class":"ir.aiga.apps.datastore.db.CategoryModel","id":5,"name":"ن"},{"class":"ir.aiga.apps.datastore.db.CategoryModel","id":6,"name":"تتاا"},{"class":"ir.aiga.apps.datastore.db.CategoryModel","id":7,"name":"بی اسم"},{"class":"ir.aiga.apps.datastore.db.CategoryModel","id":8,"name":"تسلام"},{"class":"ir.aiga.apps.datastore.db.CategoryModel","id":9,"name":"میدانم"}]}';
print json_decode($data)->{'Category'};
I use below code in java to produce the json string
String s = "{\"Category\":
";
List<CategoryModel> pmo = new ArrayList<CategoryModel>();
pmo = CategoryModule.getAllRecords(c);
s += new JSONSerializer().serialize(pmo);
s += "
}";
what's problem ?