PHP - Get last element of array
Retrieve the last item in an array of elements.
end() advances array's internal pointer to the last element, and returns its value. documentation
end({{array}})
Slice back element of array into new array. The first element is taken of this new one element array.
array_slice({{array}}, -1)[0]
array_pop() pops and returns the last value of the array, shortening the array by one element. If array is empty (or is not an array), NULL will be returned. Will additionally produce a Warning when called on a non-array. documentation
array_pop({{array}})