Mathematical Operations on Arrays in PHP
array_sumarray_productЗадание 1
Given an array:
php<?php
$arr = [1, 2, 3, 4, 5];
?>
Find the sum of the elements of this array.
Задание 2
Given an array:
php<?php
$arr = [1, 2, 3, 4, 5];
?>
Find the product (multiplication) of the elements of this array.