I found a similar question but it doesn't full fill what I need How to reset keys after unsetting values in an array?
my array is like
$fruits = array(
[0] => 'apple'
[1] => 'banana'
[3] => 'orange'
[4] => 'melon'
);
With array_values I can reset it starting from 0
array_values($fruits);
// array fixed
array(4) {
[0] => 'apple'
[1] => 'banana'
[2] => 'orange'
[3] => 'melon'
}
But I need to reset starting from 1 instead 0, is it possible?
// array fixed
array(4) {
[1] => 'apple'
[2] => 'banana'
[3] => 'orange'
[4] => 'melon'
}