質問編集履歴

1

<h2\\s\.\+>は<h2>の間違いでした申し訳ございません。

2017/03/22 09:24

投稿

bgmapinds
bgmapinds

スコア17

test CHANGED
File without changes
test CHANGED
@@ -34,7 +34,7 @@
34
34
 
35
35
  //マッチングで<h>タグを取得する
36
36
 
37
- preg_match_all('/<h2\s.+>.+<\/h2>/u', $post->post_content, $matches);
37
+ preg_match_all('/<h2>.+<\/h2>/u', $post->post_content, $matches);
38
38
 
39
39
  //取得した<h>タグの個数をカウント
40
40
 
@@ -69,3 +69,7 @@
69
69
 
70
70
 
71
71
  表示は<?php echo the_content(); ?>で行いました。
72
+
73
+
74
+
75
+ *追記 <h2\s.+>は<h2>の間違いでした申し訳ございません。