<?php $old_v = "aaaggggoooaooogg";echo preg_replace("/(.)\\1+/", "$1", $old_v);
Standard input is empty
agoaog
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!