<!DOCTYPE html><html><head></head>
<body>
<?php
function minus($result, $item){
return ($result-$item);
}
$a=[1,2,3,4,5];
echo array_sum($a); echo "<br />";
echo array_product($a); echo "<br />";
echo array_reduce($a,'minus',100);
?>
</body></html>
<!DOCTYPE html><html><head></head>
<body>
<?php
function minus($result, $item){
return ($result-$item);
}
$a=[1,2,3,4,5];
echo array_sum($a); echo "<br />";
echo array_product($a); echo "<br />";
echo array_reduce($a,'minus',100);
?>
</body></html>
15
120
85