質問編集履歴

1

配列のインデント、実施した結果を追記

2018/11/17 01:03

投稿

yuki_yuki_yuki
yuki_yuki_yuki

スコア9

test CHANGED
File without changes
test CHANGED
@@ -10,7 +10,237 @@
10
10
 
11
11
  ```PHP
12
12
 
13
- array(2) { ["statuses"]=> array(1) { [0]=> array(25) { ["created_at"]=> string(30) "Fri Nov 16 15:50:51 +0000 2018" ["id"]=> int(1063459391779692544) ["id_str"]=> string(19) "1063459391779692544" ["text"]=> string(253) "???? Model : #문가경 #은빈 ???? 주최 : #지스타 #코스프레 ???? 포토바이 : @silencemuse #촬영문의 환영합니다 #인물촬영 #인물사진 #개인화보 #개인촬영 #촬영 #모델촬영 #소수촬영… https://t.co/gtnPw2qFII" ["truncated"]=> bool(true) ["entities"]=> array(4) { ["hashtags"]=> array(12) { [0]=> array(2) { ["text"]=> string(9) "문가경" ["indices"]=> array(2) { [0]=> int(10) [1]=> int(14) } } [1]=> array(2) { ["text"]=> string(6) "은빈" ["indices"]=> array(2) { [0]=> int(15) [1]=> int(18) } } [2]=> array(2) { ["text"]=> string(9) "지스타" ["indices"]=> array(2) { [0]=> int(26) [1]=> int(30) } } [3]=> array(2) { ["text"]=> string(12) "코스프레" ["indices"]=> array(2) { [0]=> int(31) [1]=> int(36) } } [4]=> array(2) { ["text"]=> string(12) "촬영문의" ["indices"]=> array(2) { [0]=> int(59) [1]=> int(64) } } [5]=> array(2) { ["text"]=> string(12) "인물촬영" ["indices"]=> array(2) { [0]=> int(72) [1]=> int(77) } } [6]=> array(2) { ["text"]=> string(12) "인물사진" ["indices"]=> array(2) { [0]=> int(78) [1]=> int(83) } } [7]=> array(2) { ["text"]=> string(12) "개인화보" ["indices"]=> array(2) { [0]=> int(84) [1]=> int(89) } } [8]=> array(2) { ["text"]=> string(12) "개인촬영" ["indices"]=> array(2) { [0]=> int(90) [1]=> int(95) } } [9]=> array(2) { ["text"]=> string(6) "촬영" ["indices"]=> array(2) { [0]=> int(96) [1]=> int(99) } } [10]=> array(2) { ["text"]=> string(12) "모델촬영" ["indices"]=> array(2) { [0]=> int(100) [1]=> int(105) } } [11]=> array(2) { ["text"]=> string(12) "소수촬영" ["indices"]=> array(2) { [0]=> int(106) [1]=> int(111) } } } ["symbols"]=> array(0) { } ["user_mentions"]=> array(1) { [0]=> array(5) { ["screen_name"]=> string(11) "silencemuse" ["name"]=> string(18) "사일런스뮤즈" ["id"]=> int(948900166903332865) ["id_str"]=> string(18) "948900166903332865" ["indices"]=> array(2) { [0]=> int(46) [1]=> int(58) } } } ["urls"]=> array(1) { [0]=> array(4) { ["url"]=> string(23) "https://t.co/gtnPw2qFII" ["expanded_url"]=> string(52) "https://twitter.com/i/web/status/1063459391779692544" ["display_url"]=> string(29) "twitter.com/i/web/status/1…" ["indices"]=> array(2) { [0]=> int(113) [1]=> int(136) } } } } ["metadata"]=> array(2) { ["result_type"]=> string(6) "recent" ["iso_language_code"]=> string(2) "ko" } ["source"]=> string(84) "Twitter for Android" ["in_reply_to_status_id"]=> NULL ["in_reply_to_status_id_str"]=> NULL ["in_reply_to_user_id"]=> NULL ["in_reply_to_user_id_str"]=> NULL ["in_reply_to_screen_name"]=> NULL ["user"]=> array(42) { ["id"]=> int(948900166903332865) ["id_str"]=> string(18) "948900166903332865" ["name"]=> string(18) "사일런스뮤즈" ["screen_name"]=> string(11) "silencemuse" ["location"]=> string(0) "" ["description"]=> string(96) "???? Dslr : Nikon D810 ???? Lens : Nikon 58mm / 105mm ???? State : ???????? KR ???? 인물촬영" ["url"]=> string(23) "https://t.co/SV6e8uozpY" ["entities"]=> array(2) { ["url"]=> array(1) { ["urls"]=> array(1) { [0]=> array(4) { ["url"]=> string(23) "https://t.co/SV6e8uozpY" ["expanded_url"]=> string(49) "https://www.instagram.com/silencemuse_photography" ["display_url"]=> string(31) "instagram.com/silencemuse_ph…" ["indices"]=> array(2) { [0]=> int(0) [1]=> int(23) } } } } ["description"]=> array(1) { ["urls"]=> array(0) { } } } ["protected"]=> bool(false) ["followers_count"]=> int(5) ["friends_count"]=> int(26) ["listed_count"]=> int(0) ["created_at"]=> string(30) "Thu Jan 04 12:53:24 +0000 2018" ["favourites_count"]=> int(48) ["utc_offset"]=> NULL ["time_zone"]=> NULL ["geo_enabled"]=> bool(false) ["verified"]=> bool(false) ["statuses_count"]=> int(36) ["lang"]=> string(2) "ko" ["contributors_enabled"]=> bool(false) ["is_translator"]=> bool(false) ["is_translation_enabled"]=> bool(false) ["profile_background_color"]=> string(6) "F5F8FA" ["profile_background_image_url"]=> NULL ["profile_background_image_url_https"]=> NULL ["profile_background_tile"]=> bool(false) ["profile_image_url"]=> string(74) "http://pbs.twimg.com/profile_images/949590706833600512/XMfMLG6r_normal.jpg" ["profile_image_url_https"]=> string(75) "https://pbs.twimg.com/profile_images/949590706833600512/XMfMLG6r_normal.jpg" ["profile_banner_url"]=> string(67) "https://pbs.twimg.com/profile_banners/948900166903332865/1542115543" ["profile_link_color"]=> string(6) "1DA1F2" ["profile_sidebar_border_color"]=> string(6) "C0DEED" ["profile_sidebar_fill_color"]=> string(6) "DDEEF6" ["profile_text_color"]=> string(6) "333333" ["profile_use_background_image"]=> bool(true) ["has_extended_profile"]=> bool(true) ["default_profile"]=> bool(true) ["default_profile_image"]=> bool(false) ["following"]=> bool(false) ["follow_request_sent"]=> bool(false) ["notifications"]=> bool(false) ["translator_type"]=> string(4) "none" } ["geo"]=> NULL ["coordinates"]=> NULL ["place"]=> NULL ["contributors"]=> NULL ["is_quote_status"]=> bool(false) ["retweet_count"]=> int(0) ["favorite_count"]=> int(1) ["favorited"]=> bool(false) ["retweeted"]=> bool(false) ["possibly_sensitive"]=> bool(false) ["lang"]=> string(2) "ko" } } ["search_metadata"]=> array(9) { ["completed_in"]=> float(0.015) ["max_id"]=> int(1063459391779692544) ["max_id_str"]=> string(19) "1063459391779692544" ["next_results"]=> string(188) "?max_id=1063459391779692543&q=%23%E3%83%A2%E3%83%87%E3%83%AB%20-RT%20since%3A2018-11-16_00%3A00%3A00_JST%20until%3A2018-11-17_23%3A59%3A59_JST&count=1&include_entities=1&result_type=recent" ["query"]=> string(106) "%23%E3%83%A2%E3%83%87%E3%83%AB+-RT+since%3A2018-11-16_00%3A00%3A00_JST+until%3A2018-11-17_23%3A59%3A59_JST" ["refresh_url"]=> string(182) "?since_id=1063459391779692544&q=%23%E3%83%A2%E3%83%87%E3%83%AB%20-RT%20since%3A2018-11-16_00%3A00%3A00_JST%20until%3A2018-11-17_23%3A59%3A59_JST&result_type=recent&include_entities=1" ["count"]=> int(1) ["since_id"]=> int(0) ["since_id_str"]=> string(1) "0" } }
13
+ array(2)
14
+
15
+ {
16
+
17
+ ["statuses"]=> array(1)
18
+
19
+ {
20
+
21
+ [0]=> array(24)
22
+
23
+ {
24
+
25
+ ["created_at"]=> string(30) "Sat Nov 17 00:29:37 +0000 2018"
26
+
27
+ ["id"]=> int(1063589943115751424)
28
+
29
+ ["id_str"]=> string(19) "1063589943115751424"
30
+
31
+ ["text"]=> string(104) "#モンハン女子"
32
+
33
+ ["truncated"]=> bool(false)
34
+
35
+ ["entities"]=> array(4)
36
+
37
+ {
38
+
39
+ ["hashtags"]=> array(1)
40
+
41
+ {
42
+
43
+ [0]=> array(2)
44
+
45
+ {
46
+
47
+ ["text"]=> string(18) "モンハン女子"
48
+
49
+ ["indices"]=> array(2)
50
+
51
+ {
52
+
53
+ [0]=> int(35)
54
+
55
+ [1]=> int(42)
56
+
57
+ }
58
+
59
+ }
60
+
61
+ }
62
+
63
+ ["symbols"]=> array(0) { }
64
+
65
+ ["user_mentions"]=> array(0) { }
66
+
67
+ ["urls"]=> array(0) { }
68
+
69
+ }
70
+
71
+ ["metadata"]=> array(2)
72
+
73
+ {
74
+
75
+ ["iso_language_code"]=> string(2) "ja"
76
+
77
+ ["result_type"]=> string(6) "recent"
78
+
79
+ }
80
+
81
+ ["source"]=> string(66) "Twitter Web Client"
82
+
83
+ ["in_reply_to_status_id"]=> NULL
84
+
85
+ ["in_reply_to_status_id_str"]=> NULL
86
+
87
+ ["in_reply_to_user_id"]=> NULL
88
+
89
+ ["in_reply_to_user_id_str"]=> NULL
90
+
91
+ ["in_reply_to_screen_name"]=> NULL
92
+
93
+ ["user"]=> array(42)
94
+
95
+ {
96
+
97
+ ["id"]=> int(1059756301494837248)
98
+
99
+ ["id_str"]=> string(19) "1059756301494837248"
100
+
101
+ ["name"]=> string(30) "やすぅ"
102
+
103
+ ["screen_name"]=> string(10) "234908yasu"
104
+
105
+ ["location"]=> string(0) ""
106
+
107
+ ["description"]=> string(37) "????"
108
+
109
+ ["url"]=> NULL
110
+
111
+ ["entities"]=> array(1)
112
+
113
+ {
114
+
115
+ ["description"]=> array(1)
116
+
117
+ {
118
+
119
+ ["urls"]=> array(0) { }
120
+
121
+ }
122
+
123
+ }
124
+
125
+ ["protected"]=> bool(false)
126
+
127
+ ["followers_count"]=> int(4)
128
+
129
+ ["friends_count"]=> int(1)
130
+
131
+ ["listed_count"]=> int(0)
132
+
133
+ ["created_at"]=> string(30) "Tue Nov 06 10:36:06 +0000 2018"
134
+
135
+ ["favourites_count"]=> int(0)
136
+
137
+ ["utc_offset"]=> NULL
138
+
139
+ ["time_zone"]=> NULL
140
+
141
+ ["geo_enabled"]=> bool(false)
142
+
143
+ ["verified"]=> bool(false)
144
+
145
+ ["statuses_count"]=> int(57)
146
+
147
+ ["lang"]=> string(2) "ja"
148
+
149
+ ["contributors_enabled"]=> bool(false)
150
+
151
+ ["is_translator"]=> bool(false)
152
+
153
+ ["is_translation_enabled"]=> bool(false)
154
+
155
+ ["profile_background_color"]=> string(6) "F5F8FA"
156
+
157
+ ["profile_background_image_url"]=> NULL
158
+
159
+ ["profile_background_image_url_https"]=> NULL
160
+
161
+ ["profile_background_tile"]=> bool(false)
162
+
163
+ ["profile_image_url"]=> string(75) "http://pbs.twimg.com/profile_images/1061573140357177344/wv7CuFGe_normal.jpg"
164
+
165
+ ["profile_image_url_https"]=> string(76) "https://pbs.twimg.com/profile_images/1061573140357177344/wv7CuFGe_normal.jpg"
166
+
167
+ ["profile_banner_url"]=> string(68) "https://pbs.twimg.com/profile_banners/1059756301494837248/1541933750"
168
+
169
+ ["profile_link_color"]=> string(6) "1DA1F2"
170
+
171
+ ["profile_sidebar_border_color"]=> string(6) "C0DEED"
172
+
173
+ ["profile_sidebar_fill_color"]=> string(6) "DDEEF6"
174
+
175
+ ["profile_text_color"]=> string(6) "333333"
176
+
177
+ ["profile_use_background_image"]=> bool(true)
178
+
179
+ ["has_extended_profile"]=> bool(false)
180
+
181
+ ["default_profile"]=> bool(true)
182
+
183
+ ["default_profile_image"]=> bool(false)
184
+
185
+ ["following"]=> bool(false)
186
+
187
+ ["follow_request_sent"]=> bool(false)
188
+
189
+ ["notifications"]=> bool(false)
190
+
191
+ ["translator_type"]=> string(4) "none"
192
+
193
+ }
194
+
195
+ ["geo"]=> NULL
196
+
197
+ ["coordinates"]=> NULL
198
+
199
+ ["place"]=> NULL
200
+
201
+ ["contributors"]=> NULL
202
+
203
+ ["is_quote_status"]=> bool(false)
204
+
205
+ ["retweet_count"]=> int(0)
206
+
207
+ ["favorite_count"]=> int(0)
208
+
209
+ ["favorited"]=> bool(false)
210
+
211
+ ["retweeted"]=> bool(false)
212
+
213
+ ["lang"]=> string(2) "ja"
214
+
215
+ }
216
+
217
+ }
218
+
219
+ ["search_metadata"]=> array(9)
220
+
221
+ {
222
+
223
+ ["completed_in"]=> float(0.019)
224
+
225
+ ["max_id"]=> int(1063589943115751424)
226
+
227
+ ["max_id_str"]=> string(19) "1063589943115751424"
228
+
229
+ ["next_results"]=> string(215) "?max_id=1063589943115751423&q=%23%E3%83%9D%E3%83%BC%E3%83%88%E3%83%AC%E3%83%BC%E3%83%88%20-RT%20since%3A2018-11-16_00%3A00%3A00_JST%20until%3A2018-11-17_23%3A59%3A59_JST&count=1&include_entities=1&result_type=recent"
230
+
231
+ ["query"]=> string(133) "%23%E3%83%9D%E3%83%BC%E3%83%88%E3%83%AC%E3%83%BC%E3%83%88+-RT+since%3A2018-11-16_00%3A00%3A00_JST+until%3A2018-11-17_23%3A59%3A59_JST"
232
+
233
+ ["refresh_url"]=> string(209) "?since_id=1063589943115751424&q=%23%E3%83%9D%E3%83%BC%E3%83%88%E3%83%AC%E3%83%BC%E3%83%88%20-RT%20since%3A2018-11-16_00%3A00%3A00_JST%20until%3A2018-11-17_23%3A59%3A59_JST&result_type=recent&include_entities=1"
234
+
235
+ ["count"]=> int(1)
236
+
237
+ ["since_id"]=> int(0)
238
+
239
+ ["since_id_str"]=> string(1) "0"
240
+
241
+ }
242
+
243
+ }
14
244
 
15
245
  ```
16
246
 
@@ -20,11 +250,21 @@
20
250
 
21
251
  ```PHP
22
252
 
23
- foreach ($xxxx_arr as $d)
253
+ foreach ($tweets_arr["statuses"] as $d)
24
254
 
25
255
  {
26
256
 
257
+ echo $d["source"]."<br>"; ←取得できる①
258
+
259
+ foreach ($d["user"] as $e)
260
+
261
+ {
262
+
263
+ echo $e->profile_image_url_https; ←取得できない②
264
+
27
-  echo $d["profile_image_url_https"];
265
+ echo $e["profile_image_url_https"]; ←取得できない③
266
+
267
+ }
28
268
 
29
269
  }
30
270