Home > Article > Backend Development > preg_replace 替换的有关问题
preg_replace 替换的问题
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> $string = <img src="/img/pvistely/2.jpg" alt=" preg_replace 替换的有关问题 " > <img src="/img/pvistely/3.jpg" alt=" preg_replace 替换的有关问题 " > …………………… str; $pattern = array('<img src="/img/pvistely/1.jpg" alt=" preg_replace 替换的有关问题 " >','<img src="/img/pvistely/2.jpg" alt=" preg_replace 替换的有关问题 " >','<img src="/img/pvistely/3.jpg" 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/ --> …………………… ……………………