February 2013
Intermediate to advanced
538 pages
20h 55m
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; afterward, 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 />";
}Read now
Unlock full access