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

質問編集履歴

1

間違い修正

2019/09/20 16:56

投稿

erierin
erierin

スコア5

title CHANGED
File without changes
body CHANGED
@@ -60,7 +60,7 @@
60
60
  $temp_body = json_decode($response->body); //$response->bodyにjsonが入ってきます。
61
61
  for($i = 0 ; $i < count($temp_body->tour); $i++){
62
62
  $hotelname = get_hotelname_from_id($temp_body->tour[$i]->id);
63
- array_merge($temp_body->tour[$i], array('hotel_name'=> $hotelname));
63
+ $temp_body->tour[$i]=array_merge($temp_body->tour[$i], array('hotel_name'=> $hotelname));
64
64
  }
65
65
 
66
66
  $response->body = json_encode( $temp_body );
@@ -68,7 +68,7 @@
68
68
 
69
69
  print_r($response);
70
70
  ```
71
- 変更されせん。(*´-ω-`)・・・ナゼダ
71
+ NULLになってしいます。(*´-ω-`)・・・ナゼダ
72
72
 
73
73
  $temp_body->tour[$i]->id = "000";
74
74
  と書くとidは変更されます。