teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

追記

2015/03/08 02:32

投稿

退会済みユーザー
answer CHANGED
@@ -1,8 +1,17 @@
1
1
  オブジェクトで呼び出すと取得できるようになりました。
2
2
 
3
3
  ```lang-php
4
- $act = $request['act'];
4
+ $act = $request['act'];//error
5
5
  ```
6
6
  ```lang-php
7
+ $act = $request->act;//オブジェクトで
8
+ ```
9
+ もしくは
10
+ ```lang-php
11
+ $request = json_decode($postdata);
12
+ $act = $request['act'];//error
13
+ ```
14
+ ```lang-php
15
+ $request = json_decode($postdata,true);//配列化
7
- $act = $request->act;
16
+ $act = $request['act'];
8
17
  ```