以前にこの質問を投稿しましたが、誰にとっても簡単にするためにかなりの数のことを明確にする必要がありました. これをJSONで出力しようとしていますが、何もしていないようです...
{
"request": {
"act": "user_create",
"user_email": "newuser@example.com",
"user_zone": "example.com"
},
"result": "success",
"msg": "A message that will be displayed to the end user"
...
}
現在使用しているコードは次のとおりです。
<?php
$array[0]=array("request"=>array("act"=>'user_create',
"user_email"=>"newuser@example.com",
"user_zone"=>"example.com"));
$array[1]=array('result' => 'success');
$array[2]=array('msg' => 'A message that will be displayed to the end user');
echo json_encode($array);
?>
そのコードで、私はこの出力を取得していますが、これは近いですが、それほどではなく、有効な json 出力ではありません。何を変更するかはわかりませんが、現在取得しているものは次のとおりです。
[{"request":{"act":"user_create","user_email":"newuser@example.com","user_zone":"example.com"}},{"result":"success"},{"msg":"A message that will be displayed to the end user"}]
誰かが私の修正したPHPコードの例を投稿していただければ、それは素晴らしいことです. 過去数時間、さまざまなソリューションをテストして行ったり来たりしてきましたが、必要なものが正確に表示されていないようです:/事前に感謝します!