mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
Clarify meaning of $offset parameter
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@345312 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
c9558408f7
commit
3e4dcbc1d3
1 changed files with 25 additions and 0 deletions
|
@ -41,6 +41,8 @@
|
|||
start at that offset in the <parameter>array</parameter>. If
|
||||
<parameter>offset</parameter> is negative, the sequence will
|
||||
start that far from the end of the <parameter>array</parameter>.
|
||||
Note that the <parameter>offset</parameter> denotes the position in the
|
||||
array, not the key.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -142,6 +144,29 @@ Array
|
|||
[2] => c
|
||||
[3] => d
|
||||
)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>array_slice</function> and one-based array</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$input = array(1 => "a", "b", "c", "d", "e");
|
||||
print_r(array_slice($input, 1, 2));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Array
|
||||
(
|
||||
[0] => b
|
||||
[1] => c
|
||||
)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
|
Loading…
Reference in a new issue