PHP array_product() 函數(shù)計算數(shù)組中所有值的乘積
array_product ( $array );
它以整數(shù)或浮點數(shù)返回數(shù)組中值的乘積。
序號 | 參數(shù)及說明 |
---|---|
1 | array(必填) 它指定一個數(shù)組。 |
它返回數(shù)組中值的乘積。
計算數(shù)組中所有值的乘積
<?php $input = array(5,6,3); print_r(array_product($input)); ?>測試看看?/?
輸出結(jié)果:
90