Q:

Make array keys to start from 0 again in php

I have an array called $Compare, I used the print_r() function in php:
Array ([2] => Broccoli, raw [3] => Candies, butterscotch [4] => Celery, raw [10] => Apricots, raw)

I want it the keys to be in the correct order: 0,1,2,3 not 2,3,4,10!
In the end it should look like this:
Array ([0] => Broccoli, raw [1] => Candies, butterscotch [2] => Celery, raw [3] => Apricots, raw)

A:

Use array_values:
$Compare = array_values($Compare);

