strtok statement
Overview
strtok cut a string into segments, each segment is delimited by a token. For example, a string such as "This is a good example", you can extract the words using this feature:Syntax
string strtok ( string str , string token )Example with strtok
<?php
$string = "This is\ta good\nexample";
// Also use the new lines and tabs
// as word separator
$tok = strtok($string," \n\t");
while ($tok !== false) {
echo "Mot = $tok";
$tok = strtok(" \n\t");
}
?>