时间:2021-07-01 10:21:17 帮助过:17人阅读
- if(preg_match("/id=[\d]+$/",$url,$result)) {
- echo $result[1];
- }
- <br><font color="#e78608">------解决方案--------------------</font><br><dl class="code">PHP code<pre class="brush:php;toolbar:false layui-box layui-code-view layui-code-notepad"><ol class="layui-code-ol"><li>$s=<<<txt ......="" 描述="" txt;="" echo="" preg_replace('="" href=".+?id=(\d+)" is',"href="\"javascrpit:clickItem('$1')\"",$s);" <br=""><font color="#e78608">------解决方案--------------------</font><br><!--?php<br /-->$s = <<<text<br>a<br>b<br>c<br>d<br>e<br>f<br>TEXT;<br><br>echo preg_replace('/href=".+?item\\.html?.*?[^\\w]id=([0-9]+)(.*)"/i','href="javascrpit:clickItem(\'$1\')"',$s);<br>?> </text<br></txt></li></ol></pre></dl>