-1
我有一个php脚本,在我的android应用程序的json中给出响应。在json中添加响应代码
的JSON:
{"0":"1","id":"1","1":"mahmudul hasan","name":"mahmudul hasan","2":"364","roll":"364","3":"sohel","qrcode":"sohel"}
,但我也想与resonse象下面这样的状态:
{
"0": "1",
"1": "mahmudul hasan",
"2": "364",
"3": "sohel",
"id": "1",
"name": "mahmudul hasan",
"roll": "364",
"qrcode": "sohel",
**"success": true**
}
我的JSON响应PHP男女同校:
foreach ($data as $item)
{
if($item!=NULL)
{
echo json_encode($item);
}
else
{
echo json_encode($item);
}
}
应该如何我添加响应状态?
让我查一下。这是真的吗? –
@ sohel14_cse_ju编辑回答 –
我可以返回空JSON没有数据匹配吗? –