<?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[] = pop(str_split($bigToken)); //only need the first element here.
}
}
print_r($tokens);
Fatal error: Uncaught Error: Call to undefined function pop() in /in/sLnTs:9
Stack trace:
#0 {main}
thrown in /in/sLnTs on line 9
Process exited with code 255.