$string = "ABC (Test1)";echo preg_replace("/\([^)]+\)/","",$string); // 'ABC 'preg_replace是基于Perl的正则表达式替换例程。该脚本的作用是匹配所有出现的右括号,后跟任意数量的字符而不是右括号,然后再次跟右括号,然后将其删除:正则表达式细分:/ - opening delimiter (necessary for regular expressions, can be any character that doesn't appear in the regular expression\( - Match an opening parenthesis[^)]+ - Match 1 or more character that is not a closing parenthesis\) - Match a closing parenthesis/ - Closing delimiter