4つ以上の疑問符を削除したいのですが。
私は今これを使用しています:
preg_replace( '{\\?+}', '', $text );
ただし、これによりすべての疑問符が削除されます。
// Use {4,} to indicate 4 or more of the preceding thing
$pattern = '~\?{4,}~';
$str = "I have 3??? and that isn't enough";
$str2 = "I have 5????? and that is enough";
// Won't replace only 3 ?
echo preg_replace($pattern, '', $str);
// I have 3??? and that isn't enough
// Will replace 5 ?
echo preg_replace($pattern, '', $str2);
// I have 5 and that is enough