<?php $str = "Ok!!!\nReally????\nI guess.....";$res = preg_replace('/([?!.])\1+/', '$1', $str);echo $res;
Standard input is empty
Ok! Really? I guess.
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!