similiar like this example, php: remove brackets/contents from a string? i have no idea to replace
$str = \'(ABC)some text\'
into
If you want to use replace, you could use the following:
$str = "(ABC)some text"; $str = preg_replace("/^.*\(([^)]*)\).*$/", '$1', $str);
The pattern will match the whole string, and replace it with whatever it found inside the parenthesis