Returns the last element in an array.
Use end()
to return the last item in the array.
代码实现
function last($items)
{
return end($items);
}
使用样例
last([1, 2, 3]); // 3
Returns the last element in an array.
Use end()
to return the last item in the array.
function last($items)
{
return end($items);
}
last([1, 2, 3]); // 3