Name

array_reverse

Synopsis

array array_reverse(array array[, bool preserve_keys])

Returns an array containing the same elements as the input array, but whose order is reversed. If preserve_keys is set to true then numeric keys are preserved. Non-numeric keys are not affected by this parameter and are always preserved.

Get Programming PHP, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.