<?php $help = 'This endline should not be removed,but this one really should "as it\'s within the double quotation,like this", and this is another line not to be removed either," but this definitely a candidate forremoving" filler"filler filler filler filler"'; echo preg_replace('#\\n(?=[^"]*"[^"]*(?:"[^"]*"[^"]*)*$)#' , ' ', $help);
Standard input is empty
This endline should not be removed, but this one really should "as it's within the double quotation, like this", and this is another line not to be removed either, " but this definitely a candidate for removing" filler "filler filler filler filler"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!