3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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);
Output for 4.3.0 - 7.1.0
Array ( [0] => [1] => [2] => text )