March 2002
Intermediate to advanced
528 pages
21h 29m
English
strtok
string strtok(stringstring, stringtoken) string strtok(stringtoken)
Breaks string into tokens separated by any
of the characters in token and returns the
next token found. The first time you call strtok( ) on a string, use the first function prototype;
afterwards, use the second, providing only the tokens. The function
contains an internal pointer for each string it is called with. For
example:
$string = "This is the time for all good men to come to the aid of their country."
$current = strtok($string, " .;,\"'");
while(!($current === FALSE)) {
print($current . "<br />";
}