Published
- 1 min read
php remove parentheses and contents from string
The solution for this is noted below
php remove parentheses and contents from string
Solution
$string = "ABC (Test1)";
echo preg_replace("/\([^)]+\)/","",$string); // 'ABC '
Try other methods by searching on the site. That is if this doesn’t work