cvs: phpdoc-sk /reference/array/functions array-reduce.xml array-reverse.xml array-search.xml array-shift.xml

[email protected] ("Joseph Drake")
Newsgroups php.doc.sk
Message-ID <cvsjoseph1042939870@cvsserver>
joseph		Sat Jan 18 20:31:11 2003 EDT

  Added files:                 
    /phpdoc-sk/reference/array/functions	array-reduce.xml 
                                        	array-reverse.xml 
                                        	array-search.xml 
                                        	array-shift.xml 
  Log:
  we seeeeeek
joseph-20030118203111.txt (text/plain, 9.5 KB)
Index: phpdoc-sk/reference/array/functions/array-reduce.xml
+++ phpdoc-sk/reference/array/functions/array-reduce.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- EN-Revision: 1.5 Maintainer: joseph Status: ready -->
<!-- splitted from ./en/functions/array.xml, last change in rev 1.2 -->
  <refentry id="function.array-reduce">
   <refnamediv>
    <refname>array_reduce</refname>
    <refpurpose>
     Re»azovo redukuje pole na prostú hodnotu s pou¾itím funkcie
     spätného volania.
    </refpurpose>
   </refnamediv>
   <refsect1>
    <title>Popis</title>
     <methodsynopsis>
      <type>mixed</type><methodname>array_reduce</methodname>
      <methodparam><type>array</type><parameter>vstup</parameter></methodparam>
      <methodparam><type>callback</type><parameter>funkcia</parameter></methodparam>
      <methodparam choice="opt"><type>int</type><parameter>pociatocny</parameter></methodparam>
     </methodsynopsis>
    <para>
     <function>array_reduce</function> re»azovo aplikuje funkciu
     <parameter>funkcia</parameter> na prvky poµa <parameter>vstup</parameter>,
     tak, aby sa pole zredukovalo na hodnotu. Ak je pou¾itý
     voliteµný parameter <parameter>pociatocny</parameter>,
     pou¾ije sa na zaèiatku procesu alebo ako koneèný výsledok
     v prípade, keï je pole prázdne.
    </para>
    <para>
     <example>
      <title><function>array_reduce</function> príklad</title>
      <programlisting role="php">
<![CDATA[
function rsum($v, $w) {
    $v += $w;
    return $v;
}

function rmul($v, $w) {
    $v *= $w;
    return $v;
}

$a = array(1, 2, 3, 4, 5);
$x = array();
$b = array_reduce($a, "rsum");
$c = array_reduce($a, "rmul", 10);
$d = array_reduce($x, "rsum", 1);
]]>
      </programlisting>
     </example>
    </para>
    <para>
     Výsledkom tohto bude, ¾e <varname>$b</varname> obsahuje
     <literal>15</literal>, <varname>$c</varname> obsahuje
     <literal>1200</literal> (= 1*2*3*4*5*10) a
     <varname>$d</varname> obsahuje <literal>1</literal>.
    </para>
    <para>
     Tie¾ pozri <function>array_filter</function> a
     <function>array_map</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
-->

Index: phpdoc-sk/reference/array/functions/array-reverse.xml
+++ phpdoc-sk/reference/array/functions/array-reverse.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- EN-Revision: 1.4 Maintainer: joseph Status: ready -->
<!-- splitted from ./en/functions/array.xml, last change in rev 1.62 -->
  <refentry id="function.array-reverse">
   <refnamediv>
    <refname>array_reverse</refname>
    <refpurpose>
     Vráti» pole s prvkami v prevártenom poradí
    </refpurpose>
   </refnamediv>
   <refsect1>
    <title>Popis</title>
     <methodsynopsis>
      <type>array</type><methodname>array_reverse</methodname>
      <methodparam><type>array</type><parameter>pole</parameter></methodparam>
      <methodparam choice="opt"><type>bool</type><parameter>zachovat_kluce</parameter></methodparam>
     </methodsynopsis>
    <para>
     <function>array_reverse</function> vezme vstupné
     <parameter>pole</parameter> a vracia nové pole s prvkami
     v opaènom poradí, prièom sa kµúèe zachovajú ak
     <parameter>preserve_keys</parameter> je &true;.
    </para>
    <para>
     <example>
      <title><function>array_reverse</function> príklad</title>
      <programlisting role="php">
<![CDATA[
$vstup  = array ("php", 4.0, array ("zelena", "cervena"));
$vysledok = array_reverse ($vstup);
$vysledok_s_klucami = array_reverse ($vstup, TRUE);
]]>
      </programlisting>
      <para>
      Obe polia, <varname>$result</varname> aj
       <varname>$result_keyed</varname>, budú ma» rovnaké prvky, ale
       v¹imnite si rozdiel medzi kµúèami. Výpisom
       <varname>$result</varname> a
       <varname>$result_keyed</varname> bude:
       <screen role="php">
<![CDATA[
Array
(
    [0] => Array
        (
            [0] => zelena
            [1] => cervena
        )

    [1] => 4
    [2] => php
)
Array
(
    [2] => Array
        (
            [0] => zelena
            [1] => cervena
        )

    [1] => 4
    [0] => php
)
]]>
       </screen>
      </para>

     </example>
    </para>
    <note>
     <para>
      Druhý parameter bol pridaný v PHP 4.0.3.
     </para>
    </note>
   </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
-->

Index: phpdoc-sk/reference/array/functions/array-search.xml
+++ phpdoc-sk/reference/array/functions/array-search.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- EN-Revision: 1.4 Maintainer: joseph Status: ready -->
<!-- splitted from ./en/functions/array.xml, last change in rev 1.2 -->
  <refentry id="function.array-search">
   <refnamediv>
    <refname>array_search</refname>
    <refpurpose>
     Vyhµadáva v poli danú hodnotu a ak túto hodnotu
     na¹iel, vracia zodpovedajúci kµúè
    </refpurpose>
   </refnamediv>
   <refsect1>
    <title>Popis</title>
     <methodsynopsis>
      <type>mixed</type><methodname>array_search</methodname>
      <methodparam><type>mixed</type><parameter>ihla</parameter></methodparam>
      <methodparam><type>array</type><parameter>stoh_sena</parameter></methodparam>
      <methodparam choice="opt"><type>bool</type><parameter>skriktne</parameter></methodparam>
     </methodsynopsis>
    <para>
     Hµadá <parameter>ihla</parameter> v <parameter>stoh_sena</parameter>
     a vracia kµúè, ak sa v poli nájde, inak vracia &false;.
    </para>
    <note>
     <para>
      Pred PHP 4.2.0, <function>array_search</function> pri chybe
      vracala <constant>NULL</constant> namiesto &false;.
     </para>
    </note>
    <para>
     Ak je tretí voliteµný paremeter <parameter>striktne</parameter> nastavený
     na &true; potom <function>array_search</function>
     tie¾ zistí typy <parameter>ihla</parameter>
     v <parameter>stoh_sena</parameter>.
    </para>
    &return.falseproblem;
    <para>
     Tie¾ pozri <function>array_keys</function> a <function>in_array</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
-->

Index: phpdoc-sk/reference/array/functions/array-shift.xml
+++ phpdoc-sk/reference/array/functions/array-shift.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- EN-Revision: 1.5 Maintainer: joseph Status: ready -->
<!-- splitted from ./en/functions/array.xml, last change in rev 1.2 -->
  <refentry id="function.array-shift">
   <refnamediv>
    <refname>array_shift</refname>
    <refpurpose>
     Odstráni» prvok zo zaèiatku poµa
    </refpurpose>
   </refnamediv>
   <refsect1>
    <title>Popis</title>
     <methodsynopsis>
      <type>mixed</type><methodname>array_shift</methodname>
      <methodparam><type>array</type><parameter>pole</parameter></methodparam>
     </methodsynopsis>
    <para>
     <function>array_shift</function> odstraòuje prvú hodnotu v
     <parameter>pole</parameter> a vracia ju, a tým skráti
     <parameter>pole</parameter> o jeden prvok a posunie v¹etko
     ni¾¹ie. V¹etky èíselné kµúèe poµa budú modifikované tak, aby poèínali nulou
     zatiaµ èo literálne zostanú nedotknuté. Ak je <parameter>pole</parameter> prázdne 
     (alebo nie je poµom), vráti sa &null;.
    </para>
    <para>
     <example>
      <title><function>array_shift</function> príklad</title>
      <programlisting role="php">
<![CDATA[
$kopa = array ("pomaranc", "banan", "jablko", "malina");
$ovocie = array_shift ($kopa);
]]>
      </programlisting>
      <para>
       Poµu <varname>$kopa</varname> by mali po tomto zosta» 3 prvky:
       <screen role="php">
<![CDATA[
Array
(
    [0] => banan
    [1] => jablko
    [2] => malina
)
]]>
       </screen>
       a <literal>pomaranc</literal> bude priradný k
       <varname>$ovocie</varname>.
      </para>
     </example>
    </para>
    <para>
     Tie¾ pozri <function>array_unshift</function>,
     <function>array_push</function> a
     <function>array_pop</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
-->
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.