I have a php array:
Array
(
[1] => 4
[2] => 3
)
I want to +2 to all the elements of the array. So the final result will be:
Array
(
[1] => 6
[2] => 5
)
What is the shortest way with which I can achieve this?
I can iterate over the array through the loop and perform addition. But I was wondering if there is another way to achieve it.