$post = "fsafjdsafdsfasdfdsa";
$post=preg_replace("/\[img\](\r\n|\r|\n)*((http|https):\/\/([^;<>\*\(\)\"]+)|[a-z0-9\/\\\._\- ]+)\[\/img\]/isU","<img src=\"\\4\" border=0>",$post);
echo "$post";
$post=preg_replace("/\[img\](\r\n|\r|\n)*((http|https):\/\/([^;<>\*\(\)\"]+)|[a-z0-9\/\\\._\- ]+)\[\/img\]/isU","<img src=\"\\4\" border=0>",$post);
echo "$post";
echo preg_replace("/\[img\](\r\n|\r|\n)*((http|https):\/\/([^;<>\*\(\)\"]+)|[a-z0-9\/\\\._\- ]+)\[\/img\]/isU","<img src=\"\\4\" border=0>",$post);只要显示后者不显示前者的话,用4不行,什么都不显示的。
例子:http://note.w18.net/test.php