mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 17:08:54 +00:00
Added documentation for array_sum
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@42865 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
d506dda6a8
commit
236bf4c3f8
1 changed files with 36 additions and 0 deletions
|
@ -988,6 +988,42 @@ array_splice ($input, -1, 1, array("black", "maroon"));
|
|||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.array-sum">
|
||||
<refnamediv>
|
||||
<refname>array_sum</refname>
|
||||
<refpurpose>
|
||||
Calculate the sum of values in an array.
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>mixed <function>array_sum</function></funcdef>
|
||||
<paramdef>array <parameter>arr</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<function>Array_sum</function> returns the sum of values
|
||||
in an array as an integer or float.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>Array_sum</function> examples</title>
|
||||
<programlisting role="php">
|
||||
$a = array(2,4,6,8);
|
||||
echo "sum(a) = ".array_sum($a)."\n";
|
||||
// prints: sum(a) = 20
|
||||
|
||||
$b = array("a"=>1.2,"b"=>2.3,"c"=>3.4);
|
||||
echo "sum(b) = ".array_sum($b)."\n";
|
||||
// prints: sum(b) = 6.9
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.array-unique">
|
||||
<refnamediv>
|
||||
|
|
Loading…
Reference in a new issue