php - How to extract this through regular expression
PHPz
PHPz 2017-05-16 13:15:16
0
3
482
</li><li class="active"><a href="javascript:;">2</a>

How to extract 2 using regular expression in php?
2 is a variable

PHPz
PHPz

学习是最好的投资!

reply all(3)
世界只因有你
$patt = '/<\/li><li class="active"><a href="javascript:;">(\d+)<\/a>/';
$str = '</li><li class="active"><a href="javascript:;">2</a><li></a>';
preg_match($patt, $str,$arr);
var_dump($arr[1]);

For this thing, you should check how to use it only when you are using it. After all, you don’t use it much.

为情所困

'</li><li class="active"><a href="javascript:;">2</a>'.replace(/.+<li[^>]+class="active"><a[^>]+>(.+)<\/a>/,'$1')

PHPzhong

The explanation above is so comprehensive

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template