回答編集履歴

1

二つ目のコード例の添字指定にミスがあったのを修正

2015/08/28 05:51

投稿

hy3
hy3

スコア594

test CHANGED
@@ -22,6 +22,6 @@
22
22
 
23
23
  $index = rand(0, count($test_json['array']) - 1);
24
24
 
25
- $img_path = $test_json[$index]['img_path'];
25
+ $img_path = $test_json['array'][$index]['img_path'];
26
26
 
27
27
  ```