mirror of
https://github.com/php/doc-pl.git
synced 2026-03-24 15:12:16 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/pl/trunk@338467 c90b9560-bf6c-de11-be94-00142212c4b1
146 lines
3.7 KiB
XML
146 lines
3.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 0b53ec8dfb1b105a268b2428985b3e5e294b9032 Maintainer: leszek Status: ready -->
|
|
<!-- $Revision$ -->
|
|
<!-- CREDITS: sobak -->
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.array-keys">
|
|
<refnamediv>
|
|
<refname>array_keys</refname>
|
|
<refpurpose>Zwraca wszystkie klucze lub podzbiór kluczy z tablicy</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>array_keys</methodname>
|
|
<methodparam><type>array</type><parameter>tablica</parameter></methodparam>
|
|
<methodparam choice="opt"><type>mixed</type><parameter>szukana_wartość</parameter><initializer>null</initializer></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>ścisłe_porównanie</parameter><initializer>false</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>array_keys</function> zwraca klucze, numeryczne
|
|
i tekstowe, z <parameter>tablicy</parameter>.
|
|
</para>
|
|
<para>
|
|
Jeżeli opcjonalny parametr <parameter>szukana_wartość</parameter> został podany,
|
|
to zwracane są klucze tylko dla tej wartości. W przeciwnym wypadku zwrócone
|
|
zostaną wszystkie klucze z podanej <parameter>tablicy</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>tablica</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Tablica zawierająca klucze do zwrócenia.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>szukana_wartość</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Jeżeli podano, to zwracane są klucze tylko dla tej wartości.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>ścisłe_porównanie</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Określa czy podczas szukania powinno być użyte ścisłe (===) porównanie.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Zwraca tablicę wszystkich kluczy z parametru <parameter>tablica</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Przykład użycia <function>array_keys</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$array = array(0 => 100, "kolor" => "czerwony");
|
|
print_r(array_keys($array));
|
|
|
|
$array = array("niebieski", "czerwony", "zielony", "niebieski", "niebieski");
|
|
print_r(array_keys($array, "niebieski"));
|
|
|
|
$array = array("kolor" => array("niebieski", "czerwony", "zielony"),
|
|
"rozmiar" => array("mały", "średni", "duży"));
|
|
print_r(array_keys($array));
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
Array
|
|
(
|
|
[0] => 0
|
|
[1] => kolor
|
|
)
|
|
Array
|
|
(
|
|
[0] => 0
|
|
[1] => 3
|
|
[2] => 4
|
|
)
|
|
Array
|
|
(
|
|
[0] => kolor
|
|
[1] => rozmiar
|
|
)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>array_values</function></member>
|
|
<member><function>array_key_exists</function></member>
|
|
<member><function>array_search</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
|
|
-->
|