The question Remove Text Between Parentheses PHP works but only with "full" parentheses (opening and closing):
preg_replace('/\([^)]+\)/', '', $myString);
But I need it to work with unclosed parentheses too. For example:
$string1 = 'Something (unimportant stuff'; //Becomes 'Something '
$string2 = '(unimportant stuff'; //Becomes '' (empty string)
$string3 = 'Something (bad) happens'; //Becomes 'Something happens'
$string4 = 'Something)'; //Stays the same
I don't really care if I must do it with two passes (using the original answer and a new one)...