php中使用正则表达式

来源:互联网 发布:淘宝代购网店 编辑:程序博客网 时间:2024/06/02 12:22

php和.net使用正则表达式差不多,不过格式要正确

 function transfor(&$str)
 {
  $str=preg_replace("/(/[[^/[]*/])/","",$str);   //去掉<*******>
  $str=preg_replace("/(/<br/>)/","",$str);
  $str=preg_replace("/(/“)/","'",$str);
  $str=preg_replace("/(/")/","'",$str);
 }