I'm trying to figure out how to make an array add the value of the previous array, so far, looking at the PHP manual I got how to add a single value for each position of the array, but I don't understand how can I add the previous value to the actual value. That's what i got checking the manual:
<!DOCTYPE html>
<head>
</head>
<body>
<?php
foreach (array(422, 322, -52323, 7452) as &$val) {
$val = $val + 2;
echo …Run Code Online (Sandbox Code Playgroud)