The array_reverse function returns an array with elements in reverse order.

    
    $cars = array("a"=>"Volvo","b"=>"BMW","c"=>"Toyota");

    $carsReversed = array_reverse($cars);

    print_r($carsReversed);
    // Array ( [c] => Toyota [b] => BMW [a] => Volvo )