3v4l.org

run code in 300+ PHP versions simultaneously
<?php $inStr = 'Hey you guys'; $tokens = array(); $tokenList = explode(' ',$inStr); foreach($tokenList as $bigToken) { $tokens[] = $bigToken; //take care of individual words $tokens = array_merge($tokens, str_split($bigToken)); //take care of single letters for($i = 2; $i < strlen($bigToken); $i++) { $tokens[] = array_pop(str_split($bigToken)); //only need the first element here. } } print_r($tokens);

preferences:
44.81 ms | 402 KiB | 5 Q