</li><li class="active"><a href="javascript:;">2</a>
How to extract 2 using regular expression in php? 2 is a variable
学习是最好的投资!
$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')
The explanation above is so comprehensive
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')
The explanation above is so comprehensive