回答編集履歴

3

修正

2019/01/09 08:10

投稿

papinianus
papinianus

スコア12705

test CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  $out = $html->find('#stage #contents .main-contents tr .list table tr td',1);
8
8
 
9
- if(mb_strpos($out->outertext, 'href="http') !== false ) {
9
+ if(mb_strpos($out->outertext, 'href="http') === false ) {
10
10
 
11
11
  echo str_replace('href="', 'href="'.$base, $out-> outertext);
12
12
 

2

修正

2019/01/09 08:10

投稿

papinianus
papinianus

スコア12705

test CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  $out = $html->find('#stage #contents .main-contents tr .list table tr td',1);
8
8
 
9
- if(substr($out->outertext, 0, 4) !== "http" ) {
9
+ if(mb_strpos($out->outertext, 'href="http') !== false ) {
10
10
 
11
11
  echo str_replace('href="', 'href="'.$base, $out-> outertext);
12
12
 

1

ほそく

2019/01/09 08:08

投稿

papinianus
papinianus

スコア12705

test CHANGED
@@ -1,3 +1,5 @@
1
+ 前のBestAnswerからもってきて追記しました。最初の4文字がhttpかどうかで区別できるのでは?
2
+
1
3
  ```php
2
4
 
3
5
  // トピックスタイトル(ここにリンクが貼られる)