3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "Please ask your questions after the session is finished."; preg_match_all('/\h+/', $str,$matches, PREG_OFFSET_CAPTURE); $str = substr_replace($str, "\n", $matches[0][2][1], strlen($matches[0][2][0])); echo $str;

preferences:
25.9 ms | 405 KiB | 5 Q