PHP array_product() 函数
PHP 教程
· 2019-01-22 11:41:44
实例
计算并返回数组的乘积:
<?php
$a=array(5,5);
echo(array_product($a));
?>
$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));
?>
$a=array(5,5,2,10);
echo(array_product($a));
?>
点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html
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》 这本书的介绍吧!