jimw Fri Dec 7 16:27:53 2001 EDT
Modified files:
/phpdoc/en/functions strings.xml
Log:
explode: add example, clean up text a little
Index: phpdoc/en/functions/strings.xml
diff -u phpdoc/en/functions/strings.xml:1.129 phpdoc/en/functions/strings.xml:1.130
--- phpdoc/en/functions/strings.xml:1.129 Tue Dec 4 14:17:54 2001
+++ phpdoc/en/functions/strings.xml Fri Dec 7 16:27:53 2001
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.129 $ -->
+<!-- $Revision: 1.130 $ -->
<reference id="ref.strings">
<title>String functions</title>
<titleabbrev>Strings</titleabbrev>
@@ -612,14 +612,15 @@
boundaries formed by the string <parameter>separator</parameter>.
If <parameter>limit</parameter> is set, the returned array will
contain a maximum of <parameter>limit</parameter> elements with
- the last element containing the whole rest of
- <parameter>string</parameter>. If an empty string ("") is used
- as the <parameter>separator</parameter> argument, then
+ the last element containing the rest of
+ <parameter>string</parameter>.
+ </para>
+ <para>
+ If <parameter>separator</parameter> is an empty string (""),
<function>explode</function> will return &false;. If
- <parameter>separator</parameter> contains a value that is not
- contained in the <parameter>string</parameter> argument,
- then<function>explode</function> will return the
- <parameter>string</parameter> argument.
+ <parameter>separator</parameter> contains a value that is not contained
+ in <parameter>string</parameter>, then <function>explode</function> will
+ return an array containing <parameter>string</parameter>.
</para>
<note>
<para>
@@ -629,11 +630,14 @@
</note>
<para>
<example>
- <title><function>explode</function> example</title>
+ <title><function>explode</function> examples</title>
<programlisting role="php">
<![CDATA[
$pizza = "piece1 piece2 piece3 piece4 piece5 piece6";
$pieces = explode(" ", $pizza);
+
+$data = "foo:*:1023:1000::/home/foo:/bin/sh";
+list($user,$pass,$uid,$gid,$gecos,$home,$shell) = explode(":",$data);
]]>
</programlisting>
</example>