Home  >  Q&A  >  body text

I want to use preg_match_all to get the number of pages turned, but I haven’t been able to get the data.

" href="/2/2407_1/">首页</a><a class="prePage" href="/2/2407_1/">上页</a><a class="nextPage" href="/2/2407_2/">下页</a><a class="endPage" href="/2/2407_7/">尾页</a>(第1/7页)当前20条/页 输入<input id="pageinput" size="4" /><input type="button" value="跳转" onclick="page()" /></div></div>

I plan to use preg_match_all to deduct the total number of pages from the above html code

last page</a>(page 1/7)

The above 7 is the number I want to deduct,

I posted my code

preg_match_all('/尾页<\/a>(第(.*?)页)/',$content,$match);

Return result:

Array ( [0] => Array ( ) [1] => Array ( ) [2] => Array ( ) )

I know that my code should print out "1/7 ", but why is it not printed out?

And I am the most%

1853 days ago844

reply all(0)I'll reply

No reply
  • Cancelreply