Contact: aviboots(AT)netvision.net.il
41,615 questions
54,278 answers
573 users
$str = "Hello??? How are you?? What is your Wi-Fi password????"; // Replace multiple '?' with a single '?' $result = preg_replace('/\?+/', '?', $str); echo $result; /* run: Hello? How are you? What is your Wi-Fi password? */