3v4l.org

run code in 300+ PHP versions simultaneously
<?php $textbefore = "text has newlines in wo\nrds and normal newlines \n bewtween words and again in wo\nrds"; $textafter = preg_replace( "/(?<=\S)\n|\n(?=\S)/", '', $textbefore); var_dump( $textafter);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
159.27 ms | 2734 KiB | 10 Q