且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

preg_replace()模式可删除php中的括号和内容

更新时间:2023-02-22 22:42:59

应该使用以下正则表达式:

The following regular expression should do it:

$pattern = '@\(.*?\)@';

。*?是非贪婪的任何东西都匹配。

.*? is a non-greedy match of anything.