我不知道任何PHP的,但我需要讓我的JSON對象以某種方式如何使用PHP更改我的JSON對象?
$body['aps'] = array(
'alert' => "look at this stuff",
'sound' => 'default'
);
$payload = json_encode($body);
我怎樣才能讓JSON對象看起來像
{
"aps":
{
"alert": "look at this stuff",
"sound": 'default'
},
"view": "wc1"
}
那JSON是無效的,你錯過了一個','在第6行 – Halcyon
你是對的。我手打字 –