074-PHP数组元素相乘

<?php
    $arr1=array(3,4,5,6,'7',TRUE);        //等价于 3*4*5*6*7*1=2520
    $arr2=array(3,4,5,6,'7','hello');        //等价于 3*4*5*6*7*1*0=0
    echo '计算数组$arr1中元素的乘积为:'.array_product($arr1);        //对数组元素求乘积
    echo '<br />计算数组$arr2中元素的乘积为:'.array_product($arr2);        //对数组元素求乘积
?>

原文地址:https://www.cnblogs.com/tianpan2019/p/10997105.html