Source Code:
(back to article)
<?php $string = "This is a string\nwith line breaks."; $string = preg_replace('/\s+/', ' ', $string); echo $string; // Outputs: "This is a string with line breaks."
Result:
Report an issue