I want to be able to get a value from anywhere in my array, unset it, and shift the index so that my array indices are still in order.
Original array:
array:3 [
0 => 'apple'
1 => 'banana'
2 => 'orange'
3 => 'grapes'
]
Get the value of index 1, unset, and shift:
$val = 'banana';
array:2 [
0 => 'apple'
1 => 'orange'
2 => 'grapes'
]
Is there a native PHP function similar to array_pop() or array_shift() that can do this?