PHP array_product() 函数

PHP 教程 · 2019-01-22 11:41:44

实例

计算并返回数组的乘积:

<?php
$a=array(5,5);
echo(array_product($a));
?>

定义和用法

array_product() 函数计算并返回数组的乘积。

语法


array_product(array)


参数 描述
array 必需。规定数组。

技术细节

返回值: 返回一个整数或者浮点数的乘积。
PHP 版本: 5.1.0+
更新日志: 自 PHP 5.3.6 起,空数组的乘积为 1。在 PHP 5.3.6 之前,空数组的乘积为 0。

更多实例

实例 1

计算并返回数组的乘积:

<?php
$a=array(5,5,2,10);
echo(array_product($a));
?>

点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html

查看所有标签

Web Development Recipes

Web Development Recipes

Brian P. Hogan、Chris Warren、Mike Weber、Chris Johnson、Aaron Godin / Pragmatic Bookshelf / 2012-1-22 / USD 35.00

You'll see a full spectrum of cutting-edge web development techniques, from UI and eye candy recipes to solutions for data analysis, testing, and web hosting. Make buttons and content stand out with s......一起来看看 《Web Development Recipes》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

在线进制转换器
在线进制转换器

各进制数互转换器

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具