Hi guys need help with foreach loop, I need to create array, called a with the items: [10, 3, 45, 98, 4, 7, 56, 23, 3, 1]. And then use a for-each loop to sum each item with 10 and put them in a new array called b.
Check code below it work on the same $a array but how to put them in a new array?
$a = [10, 3, 45, 98, 4, 7, 56, 23, 3, 1];
$b = [];
foreach ($a as &$value) {
$value = 10 + $value;
}
echo $a;
$value =to$b[] =maybe???$b[] =