PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular

array_reverse

Tags: PHP 5.x PHP 7.x PHP 8.x

array_reverse — Return an array with elements in reverse order.

Description

array_reverse(
    array $array,
bool $preserve_keys = false
): array
Takes an input array and returns a new array with the order of the elements reversed.

Parameters

array
The input array.
preserve_keys
If set to true numeric keys are preserved.

Return Values

Returns the reversed array.