preg_replace 替换的问题
$string = <<<str …………………… <img src="/img/pvistely/1.jpg" /> <img src="/img/pvistely/2.jpg" /> <img src="/img/pvistely/3.jpg" /> ……………………str; $pattern = array('<img src="/img/pvistely/1.jpg" />','<img src="/img/pvistely/2.jpg" />','<img src="/img/pvistely/3.jpg" />'); $replace = array('[img]1.jpg[/img]','[img]2.jpg[/img]','[img]3.jpg[/img]'); echo preg_replace($pattern, $replace, $string);…………………… <[img]1.jpg[/img]> <[img]2.jpg[/img]> <[img]3.jpg[/img]> ……………………