What is the proper syntax to preg_replace()
just the parenthesis in PHP?
$search = preg_replace('/\(\)/','',$search);
Assuming you want to remove both (
and )
from the $search
string:
$search = preg_replace('/\(|\)/','',$search);
I think the fastest way to do this is using the strtr
function, like this:
$search = strtr($search, array('(' => '', ')' => ''));