30 seconds of PHP

  Back to Home

last

arraybeginner

Returns the last element in an array.

Use end() to return the last item in the array.

function last($items)
{
  return end($items);
}