mirror of
https://github.com/php/doc-pl.git
synced 2026-03-24 15:12:16 +01:00
- All id attributes are now xml:id - Add docbook namespace to all root elements - Replace <ulink /> with <link xlink:href /> - Minor markup fixes here and there - Bump EN-Revision where appropriate git-svn-id: https://svn.php.net/repository/phpdoc/pl/trunk@238334 c90b9560-bf6c-de11-be94-00142212c4b1
100 lines
2.8 KiB
XML
100 lines
2.8 KiB
XML
<?xml version="1.0" encoding="iso-8859-2"?>
|
|
<!-- EN-Revision: 1.12 Maintainer: leszek Status: ready -->
|
|
<!-- $Revision: 1.10 $ -->
|
|
<refentry xml:id="function.array-diff" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>array_diff</refname>
|
|
<refpurpose>Zwraca ró¿nice pomiêdzy tablicami</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Opis</title>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>array_diff</methodname>
|
|
<methodparam><type>array</type><parameter>tablica1</parameter></methodparam>
|
|
<methodparam><type>array</type><parameter>tablica2</parameter></methodparam>
|
|
<methodparam choice="opt"><type>array</type><parameter> ...</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>array_diff</function> zwraca tablicê zawieraj±c± wszystkie
|
|
warto¶ci tablicy <parameter>tablica1</parameter> które nie s± obecne w
|
|
innych tablicach-argumentach. Zauwa¿, ¿e zachowywane s± klucze.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Przyk³ad u¿ycia <function>array_diff</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$tablica1 = array ("a" => "zielony", "czerwony", "niebieski", "czerwony");
|
|
$tablica2 = array ("b" => "zielony", "¿ó³ty", "czerwony");
|
|
$wynik = array_diff ($tablica1, $tablica2);
|
|
|
|
print_r($wynik);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
Wielokrotne wyst±pienia w $tablica1 s± traktowane w ten sam sposób.
|
|
Powy¿szy przyk³ad wy¶wietli:
|
|
</para>
|
|
<screen>
|
|
<![CDATA[
|
|
Array
|
|
(
|
|
[1] => niebieski
|
|
)
|
|
]]>
|
|
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
<note>
|
|
<simpara>
|
|
Dwa elementy tablicy uwa¿ane s± za identyczne wtedy i tylko wtedy je¶li
|
|
<literal>(string) $element1 === (string) $element2</literal>. S³ownie:
|
|
kiedy reprezentacje elementów w postaci stringów s± identyczne.
|
|
<!-- TODO: przyk³ad... -->
|
|
</simpara>
|
|
</note>
|
|
<note>
|
|
<simpara>
|
|
Zauwa¿, ¿e funkcja ta sprawdza tylko jest wymiar n-wymiarowej tablicy.
|
|
Oczywi¶cie mo¿na sprawdziæ g³êbsze wymiary wywo³uj±c
|
|
<literal>array_diff($array1[0], $array2[0]);</literal>.
|
|
</simpara>
|
|
</note>
|
|
<warning>
|
|
<simpara>
|
|
Ta funkcja by³a zepsuta w PHP 4.0.4!
|
|
<!-- TODO: kiedy dok³adnie by³o to zepsute?... -->
|
|
</simpara>
|
|
</warning>
|
|
<para>
|
|
Patrz tak¿e: <function>array_diff_assoc</function>,
|
|
<function>array_intersect</function> i
|
|
<function>array_intersect_assoc</function>.
|
|
</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:"../../../../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
|
|
-->
|