Returns the head of a list.
Use reset()
to return the first item in the array.
代码实现
function head($items)
{
return reset($items);
}
使用样例
head([1, 2, 3]); // 1
Returns the head of a list.
Use reset()
to return the first item in the array.
function head($items)
{
return reset($items);
}
head([1, 2, 3]); // 1