PHP end() Function

The end() function moves the internal pointer to, and outputs, the last element in the array.end — Set the internal pointer of an array to its last element.end() advances array's internal pointer to the last element, and returns its value.

Example -

Example -