$wenzis="我是<图片1>";$wenzi="黑色"; $tihuanzhi = "<图片1>"; //要替换的值 $wenzis = preg_replace($tihuanzi, $wenzi, $wenzis,1);
$wenzis = "我是<图片1>";$wenzi = "黑色";$tihuanzhi = "/<图片1>/"; //要替换的值$wenzis = preg_replace($tihuanzhi, $wenzi, $wenzis,1);echo $wenzis;
搞定了,谢谢