Is there any way of tokenizing a string with the str_tok($string, $sepertors); function and then placing the tokens in an array?
//add end marker
$sentence .= " <END>";
//set characters that separate tokens
$separators = " ,!.?";
//get each token
for($token = strtok($sentence, $separators);
$token != "<END>";
$token = strtok($separators)){
//skip empty tokens
if($token != ""){
I would like to place the tokens from $sentence in an array here.
If not is there another way of breaking up a string by defined seperators and placing the pieces in an array???