array_product() 函数计算并返回数组的乘积。
语法
:
array_product(array)
参数 | 描述 |
---|---|
array | 必需。规定数组。 |
返回值: | 返回整数或者浮点数的乘积。 |
PHP 版本: | 5.1.0+ |
更新日志: | 自 PHP 5.3.6 起,空数组的乘积为 1。在 PHP 5.3.6 之前,空数组的乘积为 0。 |
//示例:
<?php
$a=array(5,5);
echo(array_product($a));
?>
//输出结果:
25
如果你发现错误或有其他见解,请给 www.zhuei.cn 留言,我们会尽快更新本文!