Blogger Information
Blog 15
fans 0
comment 0
visits 8728
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
函数计算参数乘积-19年9月28日
别的博客
Original
649 people have browsed it

实例

<?php
function sum( $a,$b,$c,...$d)
{

array_push($d,$a,$b,$c);
return array_product($d);

	
	}

echo sum(1,2,3,4,5,6);

?>

运行实例 »

点击 "运行实例" 按钮查看在线实例


function是php函数    sum是用户自定义的函数名称  

array_push运行函数   函数第一个为数组,后面为值

array_product 计算数组中所有值的乘积

测试结果为720

Correction status:qualified

Teacher's comments:写得正确
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post