mirror of
https://github.com/php/doc-pl.git
synced 2026-04-27 00:38:02 +02:00
970a89ac08
git-svn-id: https://svn.php.net/repository/phpdoc/pl/trunk@333929 c90b9560-bf6c-de11-be94-00142212c4b1
166 lines
4.0 KiB
XML
166 lines
4.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 1bdcb1b9fdcaf92904fc4fdb0d89e1a37159665e Maintainer: sobak Status: ready -->
|
|
<!-- $Revision$ -->
|
|
<refentry xml:id="function.array-fill" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>array_fill</refname>
|
|
<refpurpose>Wypełnia tablicę podanymi wartościami</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>array_fill</methodname>
|
|
<methodparam><type>int</type><parameter>indeks_początkowy</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>ilość</parameter></methodparam>
|
|
<methodparam><type>mixed</type><parameter>wartość</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Wypełnia tablicę
|
|
podaną ilością (<parameter>num</parameter>) wpisów określonych przez
|
|
<parameter>wartość</parameter> zaczynając od indeksu podanego jako
|
|
<parameter>indeks_początkowy</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
<term><parameter>indeks_początkowy</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Pierwszy klucz zwracanej tablicy.
|
|
</para>
|
|
<para>
|
|
Jeżeli <parameter>indeks_początkowy</parameter> jest ujemny,
|
|
pierwszym indeksem będzie ten podany w parametrze
|
|
<parameter>indeks początkowy</parameter> a kolejne będą numerowane
|
|
od zera
|
|
(zobacz <link linkend="function.array-fill.example.basic">przykład</link>).
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><parameter>ilość</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Ilość elementów do wstawienia.
|
|
Musi być większa od zera.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><parameter>wartość</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Wartość użyta do wypełniania.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Zwraca wypełnioną tablicę
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<para>
|
|
Wyemituje błąd <constant>E_WARNING</constant> jeżeli <parameter>ilość</parameter> jest
|
|
mniejsza niż jeden.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example xml:id="function.array-fill.example.basic">
|
|
<title>Przykład użycia <function>array_fill</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$a = array_fill(5, 6, 'banan');
|
|
$b = array_fill(-2, 4, 'gruszka');
|
|
print_r($a);
|
|
print_r($b);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
Array
|
|
(
|
|
[5] => banan
|
|
[6] => banan
|
|
[7] => banan
|
|
[8] => banan
|
|
[9] => banan
|
|
[10] => banan
|
|
)
|
|
Array
|
|
(
|
|
[-2] => gruszka
|
|
[0] => gruszka
|
|
[1] => gruszka
|
|
[2] => gruszka
|
|
)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<para>
|
|
Zobacz też sekcję manuala poświęconą <link linkend="language.types.array">tablicom</link>,
|
|
aby zobaczyć dokładne wyjaśnienie na temat ujemnych indeksów.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>array_fill_keys</function></member>
|
|
<member><function>str_repeat</function></member>
|
|
<member><function>range</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</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:"~/.phpdoc/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
|
|
-->
|