json_encode函数在 php 中数组为空时不返回大括号 {}
我有此代码
$status = array(
"message"=>"error",
"club_id"=>$_club_id,
"status"=>"1",
"membership_info"=>array(),
);
echo json_encode($status);
此函数返回 json:{"message":"error","club_id":275,"status":"1","membership_info":[]}
但是我需要这样的json:
{"message":"error","club_id":275,"status":"1","membership_info":{}}