cvs: phpdoc-da /reference/array/functions array-chunk.xml
[email protected] ("Jesper Laursen") Sun, 03 Oct 2004 12:00:21 -0000
| Newsgroups | php.doc.da |
|---|---|
| Message-ID | <cvslauer1096804821@cvsserver> |
lauer Sun Oct 3 08:00:21 2004 EDT
Added files:
/phpdoc-da/reference/array/functions array-chunk.xml
Log:
Initial translation
http://cvs.php.net/co.php/phpdoc-da/reference/array/functions/array-chunk.xml?r=1.1&p=1
Index: phpdoc-da/reference/array/functions/array-chunk.xml
+++ phpdoc-da/reference/array/functions/array-chunk.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<!-- EN-Revision: 1.9 Maintainer: lauer Status: ready -->
<refentry id="function.array-chunk">
<refnamediv>
<refname>array_chunk</refname>
<refpurpose>Deler et array op i mindre stykker</refpurpose>
</refnamediv>
<refsect1>
<title>Beskrivelse</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> deler et array op i mindre arrays med
<parameter>size</parameter> som antallet af værdier i hver. Det sidste
array vil muligvis have mindre værdier. De nye arrays bliver en del
af et nyt multidimensionelt array med et indeks startende fra nul.
</para>
<para>
Ved at sætte den valgfri parameter, <parameter>preserve_keys</parameter>,
til &true;, kan du tvinge PHP til at overføre den orginale nøgle fra
det indsatte array. Hvis du sætter den til &false; vil nøglerne starte
fra nul i alle de nye arrays. Den er som standard sat til &false;.
</para>
<example>
<title><function>array_chunk</function> eksempel</title>
<programlisting role="php">
<![CDATA[
<?php
$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>
Resultatet af overstående script:
</para>
<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>
</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
-->