mirror of
https://github.com/php/doc-de.git
synced 2026-03-26 16:22:10 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/de/trunk@111408 c90b9560-bf6c-de11-be94-00142212c4b1
111 lines
2.7 KiB
XML
111 lines
2.7 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.5 $ -->
|
|
<!-- EN-Revision: 1.6 Maintainer: tom Status: ready -->
|
|
<refentry id="function.array-chunk">
|
|
<refnamediv>
|
|
<refname>array_chunk</refname>
|
|
<refpurpose>Splittet ein Array in Teile auf</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Beschreibung</title>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>array_chunk</methodname>
|
|
<methodparam><type>array</type><parameter>input</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>size</parameter></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>preserve_keys</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>array_chunk</function> teilt das Array in verschiedene
|
|
Arrays mit <parameter>size</parameter> Werten auf. Am Ende kann
|
|
auch ein Array mit weniger Werten erzeugt werden. Die Arrays werden
|
|
als Teile eines mehrdimensionalen Arrays erzeugt, welches bei Null
|
|
und beginnend numerisch indiziert ist.
|
|
</para>
|
|
<para>
|
|
Sie können PHP dazu zwingen, die originalen Schlüssel des
|
|
Arrays input beizubehalten, indem Sie den optionalen Parameter
|
|
<parameter>preserve_keys</parameter> auf &true; setzen. Geben
|
|
Sie &false; an, werden in jedem erzeugten Array neue numerische
|
|
Indizes erzeugt, welche bei Null beginnen. Default ist &false;.
|
|
</para>
|
|
<example>
|
|
<title><function>array_chunk</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
$input_array = array('a', 'b', 'c', 'd', 'e');
|
|
print_r(array_chunk($input_array, 2));
|
|
print_r(array_chunk($input_array, 2, TRUE));
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
wird folgendes ausgeben:
|
|
<screen>
|
|
<![CDATA[
|
|
Array
|
|
(
|
|
[0] => Array
|
|
(
|
|
[0] => a
|
|
[1] => b
|
|
)
|
|
|
|
[1] => Array
|
|
(
|
|
[0] => c
|
|
[1] => d
|
|
)
|
|
|
|
[2] => Array
|
|
(
|
|
[0] => e
|
|
)
|
|
|
|
)
|
|
Array
|
|
(
|
|
[0] => Array
|
|
(
|
|
[0] => a
|
|
[1] => b
|
|
)
|
|
|
|
[1] => Array
|
|
(
|
|
[2] => c
|
|
[3] => d
|
|
)
|
|
|
|
[2] => Array
|
|
(
|
|
[4] => e
|
|
)
|
|
|
|
)
|
|
]]>
|
|
</screen>
|
|
</para>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|