21,886
社区成员
发帖
与我相关
我的任务
分享
$a1=array("/眼镜/","/有色<small>眼镜<\/small>/");
$a2=array("<small>眼镜</small>","<strong>有色眼镜</strong>");
$content="我喜欢有色眼镜,其他的眼镜不太喜欢!";
echo preg_replace($a1,$a2,$content);
<?php
$a1=array("有色眼镜","眼镜");
$a2=array(" <strong>有色眼镜 </strong>"," <small>眼镜 </small>");
$content="我喜欢有色眼镜,其他的眼镜不太喜欢!";
echo str_replace($a1,$a2,$content);
?>