私はPHPを使用していて、次のような配列を作成しようとしています。
{
"aps" : {
"alert" : "Hey"
},
"custom_control" : {
"type" : "topic_comment",
"object":{
"topic_id":"123",
"topic_section":"test"
"plan_id":"456"
}
}
}
私が持っているコードは次のとおりです。
<?php
$message = array(
"aps" => array(
"alert" => "hey"
),
"custom_control" => array(
"type" => "topic_comment",
"object" => array(
"topic_id" => "123",
"topic_section" => "abc",
"plan_id" => "456"
)
)
);
print_r($message);
?>
しかし、印刷されるのはこれです:
Array ( [aps] => Array ( [alert] => hey ) [custom_control] => Array ( [type] => topic_comment [object] => Array ( [topic_id] => 123 [topic_section] => abc [plan_id] => 456 ) ) )
これは私が意図していたものとはまったく異なるフォーマットのようです。それとも私は何らかの形で間違っていますか?
ありがとう、アレックス