Remove Text Between Parentheses PHP
问题 I'm just wondering how I could remove the text between a set of parentheses and the parentheses themselves in php. Example : ABC (Test1) I would like it to delete (Test1) and only leave ABC Thanks 回答1: $string = "ABC (Test1)"; echo preg_replace("/\([^)]+\)/","",$string); // 'ABC ' preg_replace is a perl-based regular expression replace routine. What this script does is matches all occurrences of a opening parenthesis, followed by any number of characters not a closing parenthesis, and again