strtok() splits a string into smaller strings usually called as tokens, with each token being delimited by any character from token. That is, if you have a string like "This is vijithbk" you could tokenize this string into its small words by using the space character as the token.
$string = "This is vijith";
$tok = strtok($string, " ");
while ($tok !== false)
$tok = strtok($string, " ");
while ($tok !== false)
{
echo "Word=$tok \n";
$tok = strtok(" ");
}
//Outputecho "Word=$tok \n";
$tok = strtok(" ");
}
Word=This Word=is Word=vijith
1 comment:
Hi, this post helped me a lot. Also please can you mail me the code to search email from a file. I am a newbie in php. thanks in advance..
Post a Comment