我想用php替換(
和)
之間的所有內容。替換兩個標籤之間的內容
我的字符串:
$string = "This is a (string)";
所需的輸出是:
$string = "This is a";
我的代碼不工作:
$string = "This is a (string)";
$search = "/[^(](.*)[^)]/";
$string = preg_replace($search, "", $string);
echo $string; // output is ")"