Contact: aviboots(AT)netvision.net.il
43,946 questions
57,360 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? */