Idéal pour écrire un parseur, permet de parcourir un texte "token par token".
Je rappelle qu'un "token" est une "unité de texte".
[Exemple]
$tok = new StringTokenizer("salut c'est moi toto !");
while($tok->hasNext()) {
echo "[".$tok->next()."]";
}
affichera: [salut][c'est][moi][toto][][]