I have sentences string contains this character (X.V) X variable and i want replace this (X.V) by white space i do that :
preg_replace("/\([^)]+/","",$string);
in function ($string)
but not worked
original: $string=3 mail under (2.44) on 10 examples 1 CArd A2 (4.99)
ouput: $string= 3 mail under on 10 examples 1 card A 2
Your expression
preg_replace("/\([^)]+/","",$string);
replaces opening parenthesis and all character that is not a closing parenthesis by nothing.But you want to replace something like
(X.V)
by space, you could do:In action:
output: