I have an array with numerical indices, which looks like this (after I unset some elements):

$array = [
    23 => 'banana',
    3 => 'apple',
    5 => 'pear',
];

Which function do I use to reorder them based on their key order to:

$array = [
    0 => 'apple',
    1 => 'pear',
    2 => 'banana',
];

I tried some of the sort functions but none of them provided the output I need.

Edit
Report