preg_replace 替换的问题
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> $string = <img src="/static/imghw/default1.png" data-src="/img/pvistely/2.jpg" class="lazy" alt="preg_replace 替换的有关问题" > <img src="/static/imghw/default1.png" data-src="/img/pvistely/3.jpg" class="lazy" alt="preg_replace 替换的有关问题" > ……………………str; $pattern = array('<img src="/static/imghw/default1.png" data-src="/img/pvistely/1.jpg" class="lazy" alt="preg_replace 替换的有关问题" >','<img src="/static/imghw/default1.png" data-src="/img/pvistely/2.jpg" class="lazy" alt="preg_replace 替换的有关问题" >','<img src="/static/imghw/default1.png" data-src="/img/pvistely/3.jpg" class="lazy" alt="preg_replace 替换的有关问题" >'); $replace = array('[img]1.jpg[/img]','[img]2.jpg[/img]','[img]3.jpg[/img]'); echo preg_replace($pattern, $replace, $string);
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> …………………… ……………………