30 seconds of PHP

  Back to Home

head

arraybeginner

Returns the head of a list.

Use reset() to return the first item in the array.

function head($items)
{
  return reset($items);
}