zak Fri Jan 4 20:03:26 2002 EDT
Modified files:
/phpdoc/en/functions strings.xml
Log:
Extended strtok documentation to include information about multiple tokens
Index: phpdoc/en/functions/strings.xml
diff -u phpdoc/en/functions/strings.xml:1.150 phpdoc/en/functions/strings.xml:1.151
--- phpdoc/en/functions/strings.xml:1.150 Wed Jan 2 07:26:33 2002
+++ phpdoc/en/functions/strings.xml Fri Jan 4 20:03:24 2002
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.150 $ -->
+<!-- $Revision: 1.151 $ -->
<reference id="ref.strings">
<title>String functions</title>
<titleabbrev>Strings</titleabbrev>
@@ -3386,16 +3386,19 @@
</funcprototype>
</funcsynopsis>
<para>
- <function>strtok</function> is used to tokenize a string. That
- is, if you have a string like "This is an example string" you
+ <function>strtok</function> splits a string (<parameter>arg1</parameter>)
+ into smaller strings (tokens), with each token being delimited by any
+ character from <parameter>arg2</parameter>.
+ That is, if you have a string like "This is an example string" you
could tokenize this string into its individual words by using the
space character as the token.
<example>
<title><function>strtok</function> example</title>
<programlisting role="php">
<![CDATA[
-$string = "This is an example string";
-$tok = strtok($string," ");
+$string = "This is\tan example\nstring";
+/* Use tab and newline as tokenizing characters as well */
+$tok = strtok($string," \n\t");
while ($tok) {
echo "Word=$tok<br>";
$tok = strtok(" ");