June 2024
Beginner
938 pages
15h 59m
English
Write a PHP script that lets the user enter 100 positive numerical values into an array. Then, the script must create a new array of 98 elements. This new array must contain, in each position the average value of the three elements that exist in the current and the next two positions of the user-provided array.
Solution
Let's try to understand this exercise through an example using 10 elements.

Array $newArr is the new array that is created. In array $newArr, the element at position 0 is the ...
Read now
Unlock full access