This looks very simple, but it took me a long time to figure out so I thought I'd share it incase someone else was wanting the same thing:
this should work similar to substr() but with tokens instead!
<?php
function subtok($string,$chr,$pos,$len = NULL) {
return implode($chr,array_slice(explode($chr,$string),$pos,$len));
}
?>
explode breaks the tokens up into an array, array slice alows you to pick then tokens you want, and then implode converts it back to a string
although its far from a clone, this was inspired by mIRC's gettok() function