回答編集履歴

3

誤記修正

2021/05/05 12:28

投稿

Y.H.
Y.H.

スコア7914

test CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  // $html = file_get_contents('ページのURL');
14
14
 
15
- //↓以下行に置換え
15
+ //↓以下5行に置換え
16
16
 
17
17
  $conn = curl_init(); // cURLセッションの初期化
18
18
 

2

誤記修正

2021/05/05 12:28

投稿

Y.H.
Y.H.

スコア7914

test CHANGED
@@ -1,4 +1,4 @@
1
- file_get_contents()をcurl_init()からcurl_exec()までの5行と置換えるだけでは?
1
+ file_get_contents()をcurl_init()からcurl_close()までの5行と置換えるだけでは?
2
2
 
3
3
 
4
4
 

1

回答訂正

2021/05/05 10:58

投稿

Y.H.
Y.H.

スコア7914

test CHANGED
@@ -1,4 +1,4 @@
1
- file_get_contents()をcurl_init()からcurl_exec()までの行と置換えるだけでは?
1
+ file_get_contents()をcurl_init()からcurl_exec()までの行と置換えるだけでは?
2
2
 
3
3
 
4
4
 
@@ -22,6 +22,8 @@
22
22
 
23
23
  $html = curl_exec($conn);
24
24
 
25
+ curl_close($conn); //セッションの終了
26
+
25
27
 
26
28
 
27
29
  $start_leng = mb_strpos($html,'<div id="news">') ;