cvs: phpdoc-sk /reference/array/functions array-filter.xml

From: Date: Sun, 29 Sep 2002 00:13:50 +0000
Subject: cvs: phpdoc-sk /reference/array/functions array-filter.xml
Groups: php.doc.sk 
Request: Send a blank email to doc-sk+get-79@lists.php.net to get a copy of this message
joseph Sat Sep 28 20:13:50 2002 EDT Added files: /phpdoc-sk/reference/array/functions array-filter.xml Log: array filter Index: phpdoc-sk/reference/array/functions/array-filter.xml +++ phpdoc-sk/reference/array/functions/array-filter.xml <?xml version="1.0" encoding="iso-8859-2"?> <!-- EN-Revision: 1.4 Maintainer: joseph Status: ready --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.62 --> <refentry id="function.array-filter"> <refnamediv> <refname>array_filter</refname> <refpurpose> Filtruje elementy poµa pomocou volania z funkcie </refpurpose> </refnamediv> <refsect1> <title>Popis</title> <methodsynopsis> <type>array</type><methodname>array_filter</methodname> <methodparam><type>array</type><parameter>vstup</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>volanie z funkicie</parameter></methodparam> </methodsynopsis> <para> <function>array_filter</function> vracia pole obsahujúce v¹etky elementy <parameter>input</parameter>u filtrované podµa volania z funkcie. ak je <parameter>vstup</parameter> asociatívne pole, kµúèe sa uchovajú. </para> <para> <example> <title><function>array_filter</function> príklad</title> <programlisting role="php"> <![CDATA[ function odd($var) { return ($var % 2 == 1); } function even($var) { return ($var % 2 == 0); } $pole1 = array ("a"=>1, "b"=>2, "c"=>3, "d"=>4, "e"=>5); $pole2 = array (6, 7, 8, 9, 10, 11, 12); echo "Odd :\n"; print_r(array_filter($pole1, "odd")); echo "Even:\n"; print_r(array_filter($pole2, "even")); ]]> </programlisting> <para> Výpis vy¹¹ie uvedeného programu bude: <screen role="php"> <![CDATA[ Odd : Array ( [a] => 1 [c] => 3 [e] => 5 ) Even: Array ( [0] => 6 [2] => 8 [4] => 10 [6] => 12 ) ]]> </screen> </para> </example> </para> &note.func-callback; <para> U¾ívatelia nemô¾u zmeni» samotné pole funkcie volania, t.j. Prida»/odstráni» element, vymaza» pole, na ktoré sa pou¾il <function>array_filter</function>. Ak sa zmení pole, správanie tejto funkcie nie je definované. </para> <para> See also <function>array_map</function> and <function>array_reduce</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 -->

« previous php.doc.sk (#79) next »