I come across a scenario where i have an array like this
Array
(
[24] => 24
[25] => 25
[26] => 26
[27] => 27
[28] => 28
[29] => 29
)
But i want a resultant array by including the incremented value of last and decremented value of first like this
Array
(
[24] => 24
[25] => 25
[26] => 26
[27] => 27
[28] => 28
[29] => 29
[23] => 23
[30] => 30
)
I know this is a little bit strange. But can anyone help me to find the result.
I found out the values
$f=reset($res);
$f=$f-1;
$l=end($res);
$l=$l+1;
but no idea on how to push into array