可以使用PHP的 preg_replace() 函数来去除字符串中的特殊字符。例如:
$string = "This is a (test); with % some 'characters' in it.";
$string = preg_replace('/[\(\);%\'"]/', '', $string);
echo $string;
输出:
Thisis a test with some characters in it.
可以在正则表达式中使用 [] 来匹配要去除的字符。