替换preg_replace.怎么老是【吃掉】前面的一个字符...
为什么用下面代码进行替换.怎么老是吃掉前面的一个字符......
代码如下:这两句代码都有这个问题...
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> $newstext = preg_replace('/'.$r[keyname].'/u','<a href="%5C''.%24r%5Bkeyurl%5D.'%5C'" target="\'_blank\'">'.$r[keyname].'</a>',$newstext,$public_r[repkeynum]);
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> $newstext = preg_replace('/[^=>]'.$r[keyname].'/u','<a href="%5C''.%24r%5Bkeyurl%5D.'%5C'" target="\'_blank\'">'.$r[keyname].'</a>',$newstext,$public_r[repkeynum]);