0
我有一個JSON OBJ:如何把數組在obj中的php?
$response["data"][] = array("ID" => $comment["ID"]);
我把新的OBJ是這樣的:
array_push($response["username"],"abc");
,並返回這樣的:
{"data":[{"ID":"2106"}],"username":"123"}
,但我想是這樣的:
{"data":[{"ID":"2106","username":"123"}]}
我該怎麼做?