Hi. There is a fix
here thanks to janalwin. This avoids the problems when $token evaluates to false with zero in the text. I'm not sure why you are adding the second while loop. With while ($tok !== FALSE) all of the $tok will print, but with while ($tok) printing stops after string.
PHP Code:
$string = "This/*is/*an/*example/*string/0/and/some*more*text";
$separator = "/*";
$tok = strtok($string, $separator);
while ($tok !== FALSE) { // try with while ($tok) to compare
echo "Word=$tok<br />";
$tok = strtok($separator);
}
Note how $separator is used to tokenize on / and * and what appears to be /* but it really is tokenizing when any one character is found. The while makes it tokenize on / and * so it appears to only break on */ but that is not the case.