<?$string = "asdfsdfd----sdfsdfs-sdf-sdf"; echo preg_replace('/-+/', '-', $string); ?>
Standard input is empty
asdfsdfd-sdfsdfs-sdf-sdf
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!