【发布时间】:2009-01-03 20:48:58
【问题描述】:
我希望能够切换这个...
My sample [a id="keyword" href="someURLkeyword"] test keyword test[/a] link this keyword here.
到...
My sample [a id="keyword" href="someURLkeyword"] test keyword test[/a] link this [a href="url"]keyword[/a] here.
我不能简单地替换“关键字”的所有实例,因为有些是在现有锚标记中或内部使用的。
注意:在 Linux 上使用 PHP5 preg_replace。
【问题讨论】: