php中使用正则表达式

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

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

你可能感兴趣的:(PHP,.net,正则表达式)