質問編集履歴

2

詳細な実行コードの追記

2019/08/29 06:19

投稿

muro
muro

スコア99

test CHANGED
File without changes
test CHANGED
@@ -47,3 +47,39 @@
47
47
 
48
48
 
49
49
  どのように正規表現を書けば、希望どおりの結果になるのでしょうか?
50
+
51
+
52
+
53
+ [追記]
54
+
55
+
56
+
57
+ 実際のコードは下記のとおりです。
58
+
59
+
60
+
61
+ ```php
62
+
63
+ $url = "https://twitter.com/i/activity/favorited_popup?id=".$tweet_id;
64
+
65
+ $option = [
66
+
67
+ CURLOPT_RETURNTRANSFER => true,
68
+
69
+ CURLOPT_TIMEOUT => 3,
70
+
71
+ ];
72
+
73
+ $ch = curl_init($url);
74
+
75
+ curl_setopt_array($ch, $option);
76
+
77
+ $json = curl_exec($ch);
78
+
79
+ $decode_text = json_decode($json);
80
+
81
+ $html = $decode_text->htmlContent;
82
+
83
+ preg_match_all('/data-user-id=\"+\d+/u', $html, $found_ids);
84
+
85
+ ```

1

書き間違いのため

2019/08/29 06:19

投稿

muro
muro

スコア99

test CHANGED
File without changes
test CHANGED
@@ -28,7 +28,7 @@
28
28
 
29
29
  ```php
30
30
 
31
- preg_match_all('/data-user-id=+\d+/u', $text, $found_ids);
31
+ preg_match_all('/data-user-id=\"+\d+/u', $text, $found_ids);
32
32
 
33
33
  ```
34
34