<?php $string = 'garbage ... here, more garbage here, more garbage, mor ..., garbage here, more garbage here, more garbage, mor ..., more garbage here, yet more ... garbage';$string = preg_replace('/[^,]*[.]{3}[^,]*/', '', $string);$string = preg_replace('/^,+|,+(?=,)|,+$/', '', $string); echo $string;
Standard input is empty
more garbage here, more garbage, garbage here, more garbage here, more garbage, more garbage here
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!