3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'There is something to type here. This is an example text'; $string = preg_split("/([^\s]*\s+[^\s]*\s+[^\s]*\s+[^\s]*\s+[^\s]*)\s+/", $string, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY); print_r($string);

preferences:
33.02 ms | 402 KiB | 5 Q