mIRC's gettok function basically wraps the C++ strtok function-- PHP also has a similar wrapper aptly named
strtok(). The only difference is that //echo -a $gettok(a b c, 2, 32) would be equivalent to:
$x = strtok("a b c", " ");
$y = strtok(" ");
echo $y;
(You have to call strtok(" ") to get each subsequent token. You can wrap this in a gettok-style function though)