3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'There is something to type here. This is an example text'; echo preg_replace( '~((?:\S*?\s){5})~', "$1\n", $str );

preferences:
35.88 ms | 402 KiB | 5 Q