cvs: phpdoc-sk /reference/array/functions count.xml
[email protected] ("Robert Novotny")
| Newsgroups | php.doc.sk |
|---|---|
| Message-ID | <cvsnovotnyr1043428926@cvsserver> |
novotnyr Fri Jan 24 12:22:06 2003 EDT
Added files:
/phpdoc-sk/reference/array/functions count.xml
Log:
new one
Index: phpdoc-sk/reference/array/functions/count.xml
+++ phpdoc-sk/reference/array/functions/count.xml
<?xml version="1.0" encoding="iso-8859-2"?>
<!-- EN-Revision: 1.4 Maintainer: novotnyr Status: ready -->
<!-- splitted from ./en/functions/array.xml, last change in rev 1.2 -->
<refentry id="function.count">
<refnamediv>
<refname>count</refname>
<refpurpose>Zistí poèet prvkov v premennej</refpurpose>
</refnamediv>
<refsect1>
<title>Popis</title>
<methodsynopsis>
<type>int</type><methodname>count</methodname>
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
</methodsynopsis>
<para>
Vráti poèet prvkov v parametri <parameter>var</parameter>,
ktorý je zvyèajne typu <type>array</type> (preto¾e hocièo iné obsahuje
len jeden prvok).
</para>
<para>
Ak <parameter>var</parameter> nie je pole, bude vrátená <literal>1</literal>.
(výnimka: <literal>count(&null;)</literal> vráti <literal>0</literal>).
</para>
<warning>
<para>
<function>count</function> mô¾e vráti» 0 pre premennú, ktorá nebola nastavená,
ale mô¾e vráti» p pre premennú, ktorá bola inicializovaná prázdnym poµom.
Pou¾ite
<function>isset</function> na zistenie, èi bola premenná nastavená.
</para>
</warning>
<para>
Pozrite tie¾ sekciu <link linkend="language.types.array">Polia</link>
v manuáli, kde nájdete podrobné vysvetlenie toho, ako sú v PHP implementované
a pou¾ívané polia.
</para>
<para>
<example>
<title>Príklad pou¾itia <function>count</function></title>
<programlisting role="php">
<!-- TODO: examples about count(null), count(false), count(object).. -->
<![CDATA[
$a[0] = 1;
$a[1] = 3;
$a[2] = 5;
$result = count ($a);
// $result == 3
$b[0] = 7;
$b[5] = 9;
$b[10] = 11;
$result = count ($b);
// $result == 3;
]]>
</programlisting>
</example>
</para>
<note>
<para>
Funkcia <function>sizeof</function> je <link linkend="aliases">alias</link>
pre <function>count</function>.
</para>
</note>
<para>
Pozri tie¾ <function>is_array</function>,
<function>isset</function>, a
<function>strlen</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
-->