mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
explode: add example, clean up text a little
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@64248 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
55d3600731
commit
a8467d973a
1 changed files with 13 additions and 9 deletions
|
@ -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 @@ I have <?=$foo?> foo.
|
|||
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 @@ I have <?=$foo?> foo.
|
|||
</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>
|
||||
|
|
Loading…
Reference in a new issue