我尝试更换
http://site.com/13/new new (2011).html
至
http://site.com/13/new_new_2011.html
这是我的代码,
<a href="<?php echo $row->id;?>/<?=preg_replace('#[^\w\-]+#','_', strtolower($row->showTitle()))?>.html">
$row->showTitle()是一个类似于New New (2011)的标题
但问题是因为我的链接现在看起来像这样
http://site.com/13/new_new_2011_.html
我需要从 url _.html 中删除最后一个“_”