Mathematische Operationen auf Arrays in PHP
array_sumarray_productЗадание 1
Gegeben ist ein Array:
php<?php
$arr = [1, 2, 3, 4, 5];
?>
Ermitteln Sie die Summe der Elemente dieses Arrays.
Задание 2
Gegeben ist ein Array:
php<?php
$arr = [1, 2, 3, 4, 5];
?>
Ermitteln Sie das Produkt (Multiplikation) der Elemente dieses Arrays.