wcdz 发表于 2017-3-29 09:27:42

php中使用正则表达式

  php和.net使用正则表达式差不多,不过格式要正确
  function transfor(&$str)
{
$str=preg_replace("/(\[[^\[]*\])/","",$str); //去掉<*******>
$str=preg_replace("/(\<br\>)/","",$str);
$str=preg_replace("/(\“)/","'",$str);
$str=preg_replace("/(\")/","'",$str);
}
页: [1]
查看完整版本: php中使用正则表达式